mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
nl80211: Fix non-hostapd interface addition to not call add_ifidx()
Commitb36935be1a
('nl80211: Fix EAPOL frames not being delivered') and commit147848ec4d
('nl80211: Do not add all virtual interfaces to drv->if_indices') were not fully in sync and it was possible for some non-hostapd use cases to end up adding undesired ifindexes into the list of interfaces from which events and EAPOL frames are processed on the parent interface. This could result, e.g., in P2P Device management interface on getting unexpected events, including RTM_NEWLINK event that could end up getting interpreted as an indication of the interface being down and unavailable. Make both add_ifidx() calls use the same criteria for adding interfaces to the local list. This is not really a complete solution, but it is good enough for now to fix the most visible side effects of this issue. Signed-off-by: Jithu Jance <jithu@broadcom.com>
This commit is contained in:
parent
38ddccae8f
commit
d1bb7aeda4
@ -10177,7 +10177,15 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type,
|
||||
if (drv->global)
|
||||
drv->global->if_add_ifindex = ifidx;
|
||||
|
||||
if (ifidx > 0)
|
||||
/*
|
||||
* Some virtual interfaces need to process EAPOL packets and events on
|
||||
* the parent interface. This is used mainly with hostapd.
|
||||
*/
|
||||
if (ifidx > 0 &&
|
||||
(drv->hostapd ||
|
||||
nlmode == NL80211_IFTYPE_AP_VLAN ||
|
||||
nlmode == NL80211_IFTYPE_WDS ||
|
||||
nlmode == NL80211_IFTYPE_MONITOR))
|
||||
add_ifidx(drv, ifidx);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user