nl80211: Store externally managed bridge name in driver status
This makes it easier to figure out from hostapd control interface whether an interface had been added to a bridge externally at the time hostapd interface was enabled or if the interface gets added during hostapd operations. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
cded555f06
commit
392dfd37e8
1 changed files with 10 additions and 0 deletions
|
@ -1375,11 +1375,20 @@ static void wpa_driver_nl80211_event_rtm_newlink(void *ctx,
|
||||||
wpa_driver_nl80211_event_newlink(drv, ifname);
|
wpa_driver_nl80211_event_newlink(drv, ifname);
|
||||||
|
|
||||||
if (ifi->ifi_family == AF_BRIDGE && brid) {
|
if (ifi->ifi_family == AF_BRIDGE && brid) {
|
||||||
|
struct i802_bss *bss;
|
||||||
|
|
||||||
/* device has been added to bridge */
|
/* device has been added to bridge */
|
||||||
if_indextoname(brid, namebuf);
|
if_indextoname(brid, namebuf);
|
||||||
wpa_printf(MSG_DEBUG, "nl80211: Add ifindex %u for bridge %s",
|
wpa_printf(MSG_DEBUG, "nl80211: Add ifindex %u for bridge %s",
|
||||||
brid, namebuf);
|
brid, namebuf);
|
||||||
add_ifidx(drv, brid);
|
add_ifidx(drv, brid);
|
||||||
|
|
||||||
|
for (bss = drv->first_bss; bss; bss = bss->next) {
|
||||||
|
if (os_strcmp(ifname, bss->ifname) == 0) {
|
||||||
|
os_strlcpy(bss->brname, namebuf, IFNAMSIZ);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10400,6 +10409,7 @@ static void *i802_init(struct hostapd_data *hapd,
|
||||||
wpa_printf(MSG_DEBUG, "nl80211: Interface %s is in bridge %s",
|
wpa_printf(MSG_DEBUG, "nl80211: Interface %s is in bridge %s",
|
||||||
params->ifname, brname);
|
params->ifname, brname);
|
||||||
br_ifindex = if_nametoindex(brname);
|
br_ifindex = if_nametoindex(brname);
|
||||||
|
os_strlcpy(bss->brname, brname, IFNAMSIZ);
|
||||||
} else {
|
} else {
|
||||||
brname[0] = '\0';
|
brname[0] = '\0';
|
||||||
br_ifindex = 0;
|
br_ifindex = 0;
|
||||||
|
|
Loading…
Reference in a new issue