[PATCH 2/3] mesh: Fire event on SAE authentication blocked

Masashi Honma masashi.honma
Thu Feb 5 06:00:00 PST 2015


Fire MESH-SAE-AUTH-BLOCKED event when SAE authentication blocked. This event
notify how long the STA will be blocked. The BLOCK state will finish when the
wpa_cli received new peer notification event of the identical MAC address.

Signed-off-by: Masashi Honma <masashi.honma at gmail.com>
---
 src/common/wpa_ctrl.h     | 1 +
 wpa_supplicant/mesh_rsn.c | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
index 2194b6e..1375c37 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -129,6 +129,7 @@ extern "C" {
 #define MESH_PEER_DISCONNECTED "MESH-PEER-DISCONNECTED "
 /** Mesh SAE auth failure. Wrong password suspected */
 #define MESH_SAE_AUTH_FAILURE "MESH-SAE-AUTH-FAILURE "
+#define MESH_SAE_AUTH_BLOCKED "MESH-SAE-AUTH-BLOCKED "
 
 /* WMM AC events */
 #define WMM_AC_EVENT_TSPEC_ADDED "TSPEC-ADDED "
diff --git a/wpa_supplicant/mesh_rsn.c b/wpa_supplicant/mesh_rsn.c
index 30862d9..148c292 100644
--- a/wpa_supplicant/mesh_rsn.c
+++ b/wpa_supplicant/mesh_rsn.c
@@ -28,6 +28,7 @@
 #define MESH_AUTH_TIMEOUT 10
 #define MESH_AUTH_RETRY 3
 
+
 void mesh_auth_timer(void *eloop_ctx, void *user_data)
 {
 	struct wpa_supplicant *wpa_s = eloop_ctx;
@@ -45,6 +46,10 @@ void mesh_auth_timer(void *eloop_ctx, void *user_data)
 			/* block the STA if exceeded the number of attempts */
 			wpa_mesh_set_plink_state(wpa_s, sta, PLINK_BLOCKED);
 			sta->sae->state = SAE_NOTHING;
+			wpa_msg(wpa_s, MSG_WARNING, MESH_SAE_AUTH_BLOCKED
+				"addr=" MACSTR " duration=%d",
+				MAC2STR(sta->addr),
+				wpa_s->mesh_auth_block_duration);
 		}
 		sta->sae_auth_retry++;
 	}
-- 
2.1.0




More information about the Hostap mailing list