mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-19 11:24:05 -05:00
nl80211: Add get_bss_ifindex() helper
This can be used to fetch a BSS entry based on interface index. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
f1a613118e
commit
5dfbd725a9
@ -588,6 +588,20 @@ static int is_p2p_net_interface(enum nl80211_iftype nlmode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static struct i802_bss * get_bss_ifindex(struct wpa_driver_nl80211_data *drv,
|
||||||
|
int ifindex)
|
||||||
|
{
|
||||||
|
struct i802_bss *bss;
|
||||||
|
|
||||||
|
for (bss = drv->first_bss; bss; bss = bss->next) {
|
||||||
|
if (bss->ifindex == ifindex)
|
||||||
|
return bss;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void nl80211_mark_disconnected(struct wpa_driver_nl80211_data *drv)
|
static void nl80211_mark_disconnected(struct wpa_driver_nl80211_data *drv)
|
||||||
{
|
{
|
||||||
if (drv->associated)
|
if (drv->associated)
|
||||||
@ -1688,10 +1702,7 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ifidx = nla_get_u32(ifindex);
|
ifidx = nla_get_u32(ifindex);
|
||||||
for (bss = drv->first_bss; bss; bss = bss->next)
|
bss = get_bss_ifindex(drv, ifidx);
|
||||||
if (bss->ifindex == ifidx)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (bss == NULL) {
|
if (bss == NULL) {
|
||||||
wpa_printf(MSG_WARNING, "nl80211: Unknown ifindex (%d) for channel switch, ignoring",
|
wpa_printf(MSG_WARNING, "nl80211: Unknown ifindex (%d) for channel switch, ignoring",
|
||||||
ifidx);
|
ifidx);
|
||||||
|
Loading…
Reference in New Issue
Block a user