[PATCH 2/3] mesh: Add debug message when peer is too much

Masashi Honma masashi.honma at gmail.com
Fri Dec 19 00:59:53 EST 2014


Signed-off-by: Masashi Honma <masashi.honma at gmail.com>
---
 wpa_supplicant/mesh_mpm.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c
index 3b931f8..de1d24d 100644
--- a/wpa_supplicant/mesh_mpm.c
+++ b/wpa_supplicant/mesh_mpm.c
@@ -938,8 +938,11 @@ void mesh_mpm_action_rx(struct wpa_supplicant *wpa_s,
 	/* Now we will figure out the appropriate event... */
 	switch (action_field) {
 	case PLINK_OPEN:
-		if (!plink_free_count(hapd) ||
-		    (sta->peer_lid && sta->peer_lid != plid)) {
+		if (plink_free_count(hapd) == 0) {
+			event = OPN_IGNR;
+			wpa_printf(MSG_WARNING, "MPM: Peer link num over quota(%d)",
+				   hapd->max_plinks);
+		} else if (sta->peer_lid && sta->peer_lid != plid) {
 			event = OPN_IGNR;
 		} else {
 			sta->peer_lid = plid;
@@ -947,9 +950,12 @@ void mesh_mpm_action_rx(struct wpa_supplicant *wpa_s,
 		}
 		break;
 	case PLINK_CONFIRM:
-		if (!plink_free_count(hapd) ||
-		    sta->my_lid != llid ||
-		    (sta->peer_lid && sta->peer_lid != plid)) {
+		if (plink_free_count(hapd) == 0) {
+			event = OPN_IGNR;
+			wpa_printf(MSG_WARNING, "MPM: Peer link num over quota(%d)",
+				   hapd->max_plinks);
+		} else if (sta->my_lid != llid ||
+			   (sta->peer_lid && sta->peer_lid != plid)) {
 			event = CNF_IGNR;
 		} else {
 			if (!sta->peer_lid)
-- 
1.9.1



More information about the HostAP mailing list