Browse Source

Add more debug info on deauth/disassoc events and commands

Jouni Malinen 14 years ago
parent
commit
2e75a2b3a6
2 changed files with 21 additions and 3 deletions
  1. 4 2
      src/drivers/driver_nl80211.c
  2. 17 1
      wpa_supplicant/events.c

+ 4 - 2
src/drivers/driver_nl80211.c

@@ -2412,7 +2412,8 @@ nla_put_failure:
 static int wpa_driver_nl80211_disconnect(struct wpa_driver_nl80211_data *drv,
 					 const u8 *addr, int reason_code)
 {
-	wpa_printf(MSG_DEBUG, "%s", __func__);
+	wpa_printf(MSG_DEBUG, "%s(addr=" MACSTR " reason_code=%d)",
+		   __func__, MAC2STR(addr), reason_code);
 	drv->associated = 0;
 	return wpa_driver_nl80211_mlme(drv, addr, NL80211_CMD_DISCONNECT,
 				       reason_code, 0);
@@ -2426,7 +2427,8 @@ static int wpa_driver_nl80211_deauthenticate(void *priv, const u8 *addr,
 	struct wpa_driver_nl80211_data *drv = bss->drv;
 	if (!(drv->capa.flags & WPA_DRIVER_FLAGS_SME))
 		return wpa_driver_nl80211_disconnect(drv, addr, reason_code);
-	wpa_printf(MSG_DEBUG, "%s", __func__);
+	wpa_printf(MSG_DEBUG, "%s(addr=" MACSTR " reason_code=%d)",
+		   __func__, MAC2STR(addr), reason_code);
 	drv->associated = 0;
 	return wpa_driver_nl80211_mlme(drv, addr, NL80211_CMD_DEAUTHENTICATE,
 				       reason_code, 0);

+ 17 - 1
wpa_supplicant/events.c

@@ -1604,6 +1604,13 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 		break;
 	case EVENT_DISASSOC:
 		wpa_printf(MSG_DEBUG, "Disassociation notification");
+		if (data) {
+			wpa_printf(MSG_DEBUG, " * reason %u",
+				   data->disassoc_info.reason_code);
+			if (data->disassoc_info.addr)
+				wpa_printf(MSG_DEBUG, " * address " MACSTR,
+					   MAC2STR(data->disassoc_info.addr));
+		}
 #ifdef CONFIG_AP
 		if (wpa_s->ap_iface && data) {
 			hostapd_notif_disassoc(wpa_s->ap_iface->bss[0],
@@ -1619,8 +1626,17 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 	case EVENT_DEAUTH:
 		if (event == EVENT_DEAUTH) {
 			wpa_printf(MSG_DEBUG, "Deauthentication notification");
-			if (data)
+			if (data) {
 				reason_code = data->deauth_info.reason_code;
+				wpa_printf(MSG_DEBUG, " * reason %u",
+					   data->deauth_info.reason_code);
+				if (data->deauth_info.addr) {
+					wpa_printf(MSG_DEBUG, " * address "
+						   MACSTR,
+						   MAC2STR(data->deauth_info.
+							   addr));
+				}
+			}
 		}
 #ifdef CONFIG_AP
 		if (wpa_s->ap_iface && data) {