]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Add some more details to MPM debug messages
authorJouni Malinen <j@w1.fi>
Wed, 6 Jan 2016 15:16:24 +0000 (17:16 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 6 Jan 2016 15:50:15 +0000 (17:50 +0200)
This makes it easier to follow the debug log when trying to figure out
issues with mesh peering exchange.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/mesh_mpm.c

index 21b908aa428ab454552889f9c650d09c71ceb8fd..92e47aabc03d4d652d1231ab1953989092efd7d2 100644 (file)
@@ -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(&params, 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, &params);
        if (ret) {
                wpa_msg(wpa_s, MSG_ERROR, "Driver failed to set " MACSTR