AP: Improve disconnect and timeout related logging
authorBen Greear <greearb@candelatech.com>
Sat, 10 Dec 2011 14:34:52 +0000 (16:34 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 10 Dec 2011 14:34:52 +0000 (16:34 +0200)
This previously helped when debugging some auth issues when hitting the
AP with 128 association attempts all at once.

Signed-off-by: Ben Greear <greearb@candelatech.com>
src/ap/ieee802_1x.c
src/ap/sta_info.c
src/ap/wpa_auth.c

index d2121ab..153b271 100644 (file)
@@ -1417,6 +1417,9 @@ void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta)
                 * request and we cannot continue EAP processing (EAP-Failure
                 * could only be sent if the EAP peer actually replied).
                 */
+               wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "EAP Timeout, STA " MACSTR,
+                       MAC2STR(sta->addr));
+
                sm->eap_if->portEnabled = FALSE;
                ap_sta_disconnect(hapd, sta, sta->addr,
                                  WLAN_REASON_PREV_AUTH_NOT_VALID);
index 365e9e8..61cb9f1 100644 (file)
@@ -329,9 +329,10 @@ void ap_handle_timer(void *eloop_ctx, void *timeout_ctx)
        } else if (sta->timeout_next != STA_REMOVE) {
                int deauth = sta->timeout_next == STA_DEAUTH;
 
-               wpa_printf(MSG_DEBUG, "Sending %s info to STA " MACSTR,
-                          deauth ? "deauthentication" : "disassociation",
-                          MAC2STR(sta->addr));
+               wpa_dbg(hapd->msg_ctx, MSG_DEBUG,
+                       "Timeout, sending %s info to STA " MACSTR,
+                       deauth ? "deauthentication" : "disassociation",
+                       MAC2STR(sta->addr));
 
                if (deauth) {
                        hostapd_drv_sta_deauth(
@@ -372,7 +373,7 @@ void ap_handle_timer(void *eloop_ctx, void *timeout_ctx)
        case STA_REMOVE:
                hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
                               HOSTAPD_LEVEL_INFO, "deauthenticated due to "
-                              "inactivity");
+                              "inactivity (timer DEAUTH/REMOVE)");
                if (!sta->acct_terminate_cause)
                        sta->acct_terminate_cause =
                                RADIUS_ACCT_TERMINATE_CAUSE_IDLE_TIMEOUT;
index 3d57f9e..1b5a5a2 100644 (file)
@@ -194,6 +194,7 @@ static void wpa_sta_disconnect(struct wpa_authenticator *wpa_auth,
 {
        if (wpa_auth->cb.disconnect == NULL)
                return;
+       wpa_printf(MSG_DEBUG, "wpa_sta_disconnect STA " MACSTR, MAC2STR(addr));
        wpa_auth->cb.disconnect(wpa_auth->cb.ctx, addr,
                                WLAN_REASON_PREV_AUTH_NOT_VALID);
 }