[PATCH v2] nl80211: fix EAPOL frames not being delivered

Jouni Malinen j at w1.fi
Tue Mar 25 18:52:17 EDT 2014


On Thu, Mar 20, 2014 at 07:29:44PM +0100, Maxime Bizon wrote:
> 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.

> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> @@ -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;

Adding a call to add_ifidx() makes sense, but not in this location. This
would end up adding interfaces to the list multiple times and then being
left there even after del_ifidx() call which is removing only a single
entry. I'd assume this new add_ifidx() call should be much earlier in
this function. To be more exact, where the ifdex == -ENFILE is checked.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list