]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix br_ifindex storing when hostapd creates the bridge
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 25 Nov 2014 23:14:41 +0000 (01:14 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 25 Nov 2014 23:16:35 +0000 (01:16 +0200)
Commit 6c6678e7a456d4af58a2bf24ec8f15fb8b8b24ef ('nl80211: Make
br_ifindex available in i802_bss') did not cover the case where
i802_check_bridge() ends up creating the bridge interface. That left
bss->br_ifindex zero and prevented neighbor addition. Extend that
functionality to update br_ifindex once the bridge netdev has been
added.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211.c

index 00e6c0cf6005f85fafe9b6d981786c0bab31d682..0427bcad77e4f097c5f829b81c6d2c59091ebfbd 100644 (file)
@@ -6341,7 +6341,6 @@ static int i802_check_bridge(struct wpa_driver_nl80211_data *drv,
 
        os_strlcpy(bss->brname, brname, IFNAMSIZ);
        br_ifindex = if_nametoindex(brname);
-       bss->br_ifindex = br_ifindex;
        if (br_ifindex == 0) {
                /*
                 * Bridge was configured, but the bridge device does
@@ -6354,8 +6353,10 @@ static int i802_check_bridge(struct wpa_driver_nl80211_data *drv,
                        return -1;
                }
                bss->added_bridge = 1;
-               add_ifidx(drv, if_nametoindex(brname));
+               br_ifindex = if_nametoindex(brname);
+               add_ifidx(drv, br_ifindex);
        }
+       bss->br_ifindex = br_ifindex;
 
        if (linux_br_get(in_br, ifname) == 0) {
                if (os_strcmp(in_br, brname) == 0)