From 147848ec4d26613d5a117d4b35dbc7ff98dd65d1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 27 May 2014 18:47:41 +0300 Subject: [PATCH] nl80211: Do not add all virtual interfaces to drv->if_indices 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 --- src/drivers/driver_nl80211.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index fe8e908b3..9f7d0f562 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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)) {