From b5f5c32412718c721127742c9ce80d0f2233eb4b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 6 Jan 2016 17:16:24 +0200 Subject: [PATCH] mesh: Add some more details to MPM debug messages This makes it easier to follow the debug log when trying to figure out issues with mesh peering exchange. Signed-off-by: Jouni Malinen --- wpa_supplicant/mesh_mpm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c index 21b908aa4..92e47aabc 100644 --- a/wpa_supplicant/mesh_mpm.c +++ b/wpa_supplicant/mesh_mpm.c @@ -43,6 +43,7 @@ enum plink_event { }; static const char * const mplstate[] = { + [0] = "UNINITIALIZED", [PLINK_LISTEN] = "LISTEN", [PLINK_OPEN_SENT] = "OPEN_SENT", [PLINK_OPEN_RCVD] = "OPEN_RCVD", @@ -360,6 +361,9 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s, goto fail; } + wpa_msg(wpa_s, MSG_DEBUG, "Mesh MPM: Sending peering frame type %d to " + MACSTR " (my_lid=0x%x peer_lid=0x%x)", + type, MAC2STR(sta->addr), sta->my_lid, sta->peer_lid); ret = wpa_drv_send_action(wpa_s, wpa_s->assoc_freq, 0, sta->addr, wpa_s->own_addr, wpa_s->own_addr, wpabuf_head(buf), wpabuf_len(buf), 0); @@ -380,6 +384,9 @@ void wpa_mesh_set_plink_state(struct wpa_supplicant *wpa_s, struct hostapd_sta_add_params params; int ret; + wpa_msg(wpa_s, MSG_DEBUG, "MPM set " MACSTR " from %s into %s", + MAC2STR(sta->addr), mplstate[sta->plink_state], + mplstate[state]); sta->plink_state = state; os_memset(¶ms, 0, sizeof(params)); @@ -387,8 +394,6 @@ void wpa_mesh_set_plink_state(struct wpa_supplicant *wpa_s, params.plink_state = state; params.set = 1; - wpa_msg(wpa_s, MSG_DEBUG, "MPM set " MACSTR " into %s", - MAC2STR(sta->addr), mplstate[state]); ret = wpa_drv_sta_add(wpa_s, ¶ms); if (ret) { wpa_msg(wpa_s, MSG_ERROR, "Driver failed to set " MACSTR -- 2.39.5