From 8997613c902d1c9b878860d93a990eee910d85e6 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 26 Nov 2014 01:14:41 +0200 Subject: [PATCH] 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 --- src/drivers/driver_nl80211.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) -- 2.47.2