[PATCH] nl80211: fix EAPOL frames not being delivered

Maxime Bizon mbizon
Thu Mar 20 11:25:10 PDT 2014


When hostapd choose to reuse an existing interface, it does not add it
to the set of interfaces from which we accept EAPOL packets.

Make sure we always add it to that set.

Signed-off-by: Maxime Bizon <mbizon at freebox.fr>
---
 src/drivers/driver_nl80211.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index fb2847f..bb71814 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -7645,13 +7645,13 @@ static int nl80211_create_iface(struct wpa_driver_nl80211_data *drv,
 				int (*handler)(struct nl_msg *, void *),
 				void *arg, int use_existing)
 {
-	int ret;
+	int ret, ifidx;
 
 	ret = nl80211_create_iface_once(drv, ifname, iftype, addr, wds, handler,
 					arg);
 
 	/* if error occurred and interface exists already */
-	if (ret == -ENFILE && if_nametoindex(ifname)) {
+	if (ret == -ENFILE && (ifidx = if_nametoindex(ifname))) {
 		if (use_existing) {
 			wpa_printf(MSG_DEBUG, "nl80211: Continue using existing interface %s",
 				   ifname);
@@ -9862,6 +9862,9 @@ 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 (drv->nlmode != NL80211_IFTYPE_P2P_DEVICE)
+		add_ifidx(drv, ifidx);
+
 	return 0;
 }
 
-- 
1.7.9.5




More information about the Hostap mailing list