nl80211: Fix br_ifindex storing when hostapd creates the bridge

Commit 6c6678e7a4 ('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>
This commit is contained in:
Jouni Malinen 2014-11-26 01:14:41 +02:00 committed by Jouni Malinen
parent a6b4ee217a
commit 8997613c90

View 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)