Patchwork [1/5] hostapd: fix WDS VLAN bridge handling

login
register
mail settings
Submitter Felix Fietkau
Date Sept. 14, 2012, 1:12 p.m.
Message ID <1347628349-34362-1-git-send-email-nbd@openwrt.org>
Download mbox | patch
Permalink /patch/183919/
State Accepted
Commit c34e618d473c2572bf77daedec399e823fe6a262
Headers show

Comments

Felix Fietkau - Sept. 14, 2012, 1:12 p.m.
This patch fixes an issue where removing a WDS VLAN interface also removed the
main AP interface from the same bridge.

Signed-hostap: Felix Fietkau <nbd@openwrt.org>
---
 src/drivers/driver_nl80211.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Jouni Malinen - Sept. 16, 2012, 5:41 a.m.
On Fri, Sep 14, 2012 at 03:12:25PM +0200, Felix Fietkau wrote:
> This patch fixes an issue where removing a WDS VLAN interface also removed the
> main AP interface from the same bridge.

Thanks, applied.

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 1117d06..6779877 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -7698,6 +7698,10 @@  static int i802_set_wds_sta(void *priv, const u8 *addr, int aid, int val,
 		}
 		return i802_set_sta_vlan(priv, addr, name, 0);
 	} else {
+		if (bridge_ifname)
+			linux_br_del_if(drv->global->ioctl_sock, bridge_ifname,
+					name);
+
 		i802_set_sta_vlan(priv, addr, bss->ifname, 0);
 		return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
 						    name);
@@ -8065,7 +8069,12 @@  static int wpa_driver_nl80211_if_remove(void *priv,
 	if (ifindex <= 0)
 		return -1;
 
+	nl80211_remove_iface(drv, ifindex);
+
 #ifdef HOSTAPD
+	if (type != WPA_IF_AP_BSS)
+		return 0;
+
 	if (bss->added_if_into_bridge) {
 		if (linux_br_del_if(drv->global->ioctl_sock, bss->brname,
 				    bss->ifname) < 0)
@@ -8079,13 +8088,6 @@  static int wpa_driver_nl80211_if_remove(void *priv,
 				   "bridge %s: %s",
 				   bss->brname, strerror(errno));
 	}
-#endif /* HOSTAPD */
-
-	nl80211_remove_iface(drv, ifindex);
-
-#ifdef HOSTAPD
-	if (type != WPA_IF_AP_BSS)
-		return 0;
 
 	if (bss != &drv->first_bss) {
 		struct i802_bss *tbss;