Patchwork nl80211: fix EAPOL frames not being delivered

login
register
mail settings
Submitter Maxime Bizon
Date March 20, 2014, 6:25 p.m.
Message ID <1395339910-4597-1-git-send-email-mbizon@freebox.fr>
Download mbox | patch
Permalink /patch/332350/
State Superseded
Headers show

Comments

Maxime Bizon - March 20, 2014, 6:25 p.m.
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@freebox.fr>
---
 src/drivers/driver_nl80211.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Maxime Bizon - March 20, 2014, 6:26 p.m.
On Thu, 2014-03-20 at 19:25 +0100, Maxime Bizon wrote:

> 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);

Bad hunk, leftover from a previous patch, will repost V2 sorry

Patch

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;
 }