]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix non-hostapd interface addition to not call add_ifidx()
authorJithu Jance <jithu@broadcom.com>
Mon, 16 Jun 2014 21:40:55 +0000 (00:40 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 16 Jun 2014 22:35:07 +0000 (01:35 +0300)
Commit b36935be1a14341771b0fd5491808c3f6fdcb603 ('nl80211: Fix EAPOL
frames not being delivered') and commit
147848ec4d26613d5a117d4b35dbc7ff98dd65d1 ('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>
src/drivers/driver_nl80211.c

index 756865387746bcb4a2d23280e3671039004bdfad..aa2cd04afe2e254634cdf13f2f6a692e5a6025aa 100644 (file)
@@ -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;