]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Fix WDS VLAN bridge handling
authorFelix Fietkau <nbd@openwrt.org>
Sun, 16 Sep 2012 05:38:14 +0000 (22:38 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 16 Sep 2012 05:38:14 +0000 (22:38 -0700)
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

index 1117d061401b1c8aa9d9100475d6f6501f84c261..6779877fbf9232e2381f70939ecae8327cb67868 100644 (file)
@@ -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;