[PATCH 2/3] mesh: Suppress new peer notification while processing

Masashi Honma masashi.honma
Wed Jan 21 21:22:17 PST 2015


Our patch for mac80211 has already merged.
http://git.kernel.org/cgit/linux/kernel/git/linville/wireless-testing.git/commit/?id=2ae70efcea7a695a62bb47170d3fb16674b8dbea

The patch fires new peer notification frequently. The notification restarts SAE
authentication when it will be received while SAE authentication is in progress.

So this patch suppresses such undesired new peer notifications.

Signed-off-by: Kenzoh Nishikawa <Kenzoh.Nishikawa at jp.sony.com>
Signed-off-by: Masashi Honma <masashi.honma at gmail.com>
---
 wpa_supplicant/mesh_mpm.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c
index 51f82f5..cddeb01 100644
--- a/wpa_supplicant/mesh_mpm.c
+++ b/wpa_supplicant/mesh_mpm.c
@@ -537,11 +537,12 @@ void wpa_mesh_new_mesh_peer(struct wpa_supplicant *wpa_s, const u8 *addr,
 	int ret = 0;
 
 	sta = ap_get_sta(data, addr);
-	if (!sta) {
-		sta = ap_sta_add(data, addr);
-		if (!sta)
-			return;
-	}
+	if (sta)
+		goto end;
+
+	sta = ap_sta_add(data, addr);
+	if (!sta)
+		return;
 
 	/* initialize sta */
 	if (copy_supp_rates(wpa_s, sta, elems))
@@ -611,10 +612,15 @@ void wpa_mesh_new_mesh_peer(struct wpa_supplicant *wpa_s, const u8 *addr,
 		return;
 	}
 
-	if (conf->security == MESH_CONF_SEC_NONE)
-		mesh_mpm_plink_open(wpa_s, sta, PLINK_OPEN_SENT);
-	else
-		mesh_rsn_auth_sae_sta(wpa_s, sta);
+ end:
+	if (sta->plink_state == PLINK_LISTEN) {
+		if (!sta->my_lid)
+			mesh_mpm_init_link(wpa_s, sta);
+		if (conf->security == MESH_CONF_SEC_NONE)
+			mesh_mpm_plink_open(wpa_s, sta, PLINK_OPEN_SENT);
+		else if (sta->sae == NULL || sta->sae->state == SAE_NOTHING)
+			mesh_rsn_auth_sae_sta(wpa_s, sta);
+	}
 }
 
 
-- 
1.9.1




More information about the Hostap mailing list