]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Do not add all virtual interfaces to drv->if_indices
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 27 May 2014 15:47:41 +0000 (18:47 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 27 May 2014 15:47:41 +0000 (18:47 +0300)
Commit 04eff7d5ba96b5b452e4e1a70db3af6668762b08 or something around that
timeframe may have caused a regression on how drv->if_indices gets used
with wpa_supplicant. Most (curretly likely all) wpa_supplicant virtual
interface use cases should not actually use this. This could result in
issues with P2P group interfaces delivering events to incorrect
interface (parent rather than the group interface). The previous commit
removed some of the issues, but more complete fix is to undo some of
those merged hostapd/wpa_supplicant operations.

Filter add_ifidx() uses based on hostapd vs. wpa_supplicant and iftype
to get closer to the earlier wpa_supplicant behavior for the driver
events from virtual interfaces.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211.c

index fe8e908b32e16000812159dfbf28e47a2cd117eb..9f7d0f562b943a2f7acff789d32684f1cef92ba2 100644 (file)
@@ -7811,8 +7811,17 @@ static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv,
        if (ifidx <= 0)
                return -1;
 
-       /* start listening for EAPOL on this interface */
-       add_ifidx(drv, ifidx);
+       /*
+        * Some virtual interfaces need to process EAPOL packets and events on
+        * the parent interface. This is used mainly with hostapd.
+        */
+       if (drv->hostapd ||
+           iftype == NL80211_IFTYPE_AP_VLAN ||
+           iftype == NL80211_IFTYPE_WDS ||
+           iftype == NL80211_IFTYPE_MONITOR) {
+               /* start listening for EAPOL on this interface */
+               add_ifidx(drv, ifidx);
+       }
 
        if (addr && iftype != NL80211_IFTYPE_MONITOR &&
            linux_set_ifhwaddr(drv->global->ioctl_sock, ifname, addr)) {