From: Jouni Malinen Date: Tue, 25 Nov 2014 23:14:41 +0000 (+0200) Subject: nl80211: Fix br_ifindex storing when hostapd creates the bridge X-Git-Tag: hostap_2_4~1024 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8997613c902d1c9b878860d93a990eee910d85e6;p=thirdparty%2Fhostap.git nl80211: Fix br_ifindex storing when hostapd creates the bridge 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 --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 00e6c0cf6..0427bcad7 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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)