diff mbox series

Revert "rtnl: Ignore adding/removing interface to/from bridge"

Message ID 20240909044515.2863247-1-net147@gmail.com (mailing list archive)
State Accepted
Commit 99d4f2f252dbbc665faa28713c248737288dcead
Headers show
Series Revert "rtnl: Ignore adding/removing interface to/from bridge" | expand

Commit Message

Jonathan Liu Sept. 9, 2024, 4:45 a.m. UTC
This reverts commit 64ba5d457c77ebb65b0a23910d26089973fb6ce7.

It is causing the wireless interface to remain in AP mode and the tether
SSID to still be visible after disabling tethering when using
wpa_supplicant. This can be confirmed with "iw dev wlan0 info" which
shows "type managed" before enabling tethering, "type AP" after enabling
tethering and "type AP" after disabling terhering when it should change
back to "type managed".
---
 src/rtnl.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

Comments

patchwork-bot+connman@kernel.org Sept. 9, 2024, 7 a.m. UTC | #1
Hello:

This patch was applied to connman.git (master)
by Marcel Holtmann <marcel@holtmann.org>:

On Mon,  9 Sep 2024 14:45:15 +1000 you wrote:
> This reverts commit 64ba5d457c77ebb65b0a23910d26089973fb6ce7.
> 
> It is causing the wireless interface to remain in AP mode and the tether
> SSID to still be visible after disabling tethering when using
> wpa_supplicant. This can be confirmed with "iw dev wlan0 info" which
> shows "type managed" before enabling tethering, "type AP" after enabling
> tethering and "type AP" after disabling terhering when it should change
> back to "type managed".
> 
> [...]

Here is the summary with links:
  - Revert "rtnl: Ignore adding/removing interface to/from bridge"
    https://git.kernel.org/pub/scm/network/connman/connman.git/?id=99d4f2f252db

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/rtnl.c b/src/rtnl.c
index a28370ae..64ba6086 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -926,7 +926,7 @@  static inline void print_attr(struct rtattr *attr, const char *name)
 		print("  attr %d (len %d)\n", attr->rta_type, len);
 }
 
-static void rtnl_link(struct nlmsghdr *hdr, bool *has_master)
+static void rtnl_link(struct nlmsghdr *hdr)
 {
 	struct ifinfomsg *msg;
 	struct rtattr *attr;
@@ -968,7 +968,6 @@  static void rtnl_link(struct nlmsghdr *hdr, bool *has_master)
 			print_attr(attr, "priority");
 			break;
 		case IFLA_MASTER:
-			*has_master = true;
 			print_attr(attr, "master");
 			break;
 		case IFLA_WIRELESS:
@@ -1001,32 +1000,22 @@  static void rtnl_link(struct nlmsghdr *hdr, bool *has_master)
 
 static void rtnl_newlink(struct nlmsghdr *hdr)
 {
-	bool has_master = false;
 	struct ifinfomsg *msg = (struct ifinfomsg *) NLMSG_DATA(hdr);
 
-	rtnl_link(hdr, &has_master);
+	rtnl_link(hdr);
 
 	if (hdr->nlmsg_type == IFLA_WIRELESS)
 		connman_warn_once("Obsolete WEXT WiFi driver detected");
 
-	/* ignore RTM_NEWLINK when adding interface to bridge */
-	if (has_master)
-		return;
-
 	process_newlink(msg->ifi_type, msg->ifi_index, msg->ifi_flags,
 				msg->ifi_change, msg, IFA_PAYLOAD(hdr));
 }
 
 static void rtnl_dellink(struct nlmsghdr *hdr)
 {
-	bool has_master = false;
 	struct ifinfomsg *msg = (struct ifinfomsg *) NLMSG_DATA(hdr);
 
-	rtnl_link(hdr, &has_master);
-
-	/* ignore RTM_DELLINK when removing interface from bridge */
-	if (has_master)
-		return;
+	rtnl_link(hdr);
 
 	process_dellink(msg->ifi_type, msg->ifi_index, msg->ifi_flags,
 				msg->ifi_change, msg, IFA_PAYLOAD(hdr));