[RFC 09/13] hostap: Ensure debug messages for all PREV_AUTH_NOT_VALID uses.

greearb at candelatech.com greearb
Fri Oct 14 15:34:33 PDT 2011


From: Ben Greear <greearb at candelatech.com>

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
:100644 100644 195b8a7... f66204b... M	hostapd/ctrl_iface.c
:100644 100644 4dad78a... 2092b52... M	src/ap/hostapd.c
:100644 100644 a06f956... d445686... M	src/ap/ieee802_1x.c
:100644 100644 958edd3... f414f31... M	src/ap/sta_info.c
:100644 100644 e63ee90... 8da4d40... M	src/ap/wpa_auth.c
:100644 100644 d1fdfa8... 1dd7a40... M	src/drivers/driver_nl80211.c
 hostapd/ctrl_iface.c         |   10 +++++-----
 src/ap/hostapd.c             |    2 +-
 src/ap/ieee802_1x.c          |    5 ++++-
 src/ap/sta_info.c            |    9 +++++----
 src/ap/wpa_auth.c            |    3 +++
 src/drivers/driver_nl80211.c |    3 +++
 6 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 195b8a7..f66204b 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -174,9 +174,9 @@ static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
 	if (mgmt == NULL)
 		return -1;
 
-	wpa_printf(MSG_DEBUG, "P2P: Disconnect STA " MACSTR " with minor "
-		   "reason code %u (stype=%u)",
-		   MAC2STR(addr), minor_reason_code, stype);
+	wpa_msg(hapd, MSG_DEBUG, "P2P: Disconnect STA " MACSTR " with minor "
+		"reason code %u (stype=%u)",
+		MAC2STR(addr), minor_reason_code, stype);
 
 	mgmt->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT, stype);
 	os_memcpy(mgmt->da, addr, ETH_ALEN);
@@ -219,7 +219,7 @@ static int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd,
 	struct sta_info *sta;
 	const char *pos;
 
-	wpa_printf(MSG_DEBUG, "CTRL_IFACE DEAUTHENTICATE %s", txtaddr);
+	wpa_msg(hapd, MSG_DEBUG, "CTRL_IFACE DEAUTHENTICATE %s", txtaddr);
 
 	if (hwaddr_aton(txtaddr, addr))
 		return -1;
@@ -275,7 +275,7 @@ static int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd,
 	struct sta_info *sta;
 	const char *pos;
 
-	wpa_printf(MSG_DEBUG, "CTRL_IFACE DISASSOCIATE %s", txtaddr);
+	wpa_msg(hapd, MSG_DEBUG, "CTRL_IFACE DISASSOCIATE %s", txtaddr);
 
 	if (hwaddr_aton(txtaddr, addr))
 		return -1;
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 4dad78a..2092b52 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -348,7 +348,7 @@ static int hostapd_flush_old_stations(struct hostapd_data *hapd)
 		wpa_printf(MSG_WARNING, "Could not connect to kernel driver.");
 		ret = -1;
 	}
-	wpa_printf(MSG_DEBUG, "Deauthenticate all stations");
+	wpa_msg(hapd, MSG_DEBUG, "Deauthenticate all stations");
 	os_memset(addr, 0xff, ETH_ALEN);
 	hostapd_drv_sta_deauth(hapd, addr, WLAN_REASON_PREV_AUTH_NOT_VALID);
 	hostapd_free_stas(hapd);
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index a06f956..d445686 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -1423,6 +1423,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_msg(hapd, 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);
@@ -2091,7 +2094,7 @@ static void ieee802_1x_finished(struct hostapd_data *hapd,
 		 * EAP-FAST with anonymous provisioning, may require another
 		 * EAPOL authentication to be started to complete connection.
 		 */
-		wpa_printf(MSG_DEBUG, "IEEE 802.1X: Force disconnection after "
+		wpa_msg(hapd, MSG_DEBUG, "IEEE 802.1X: Force disconnection after "
 			   "EAP-Failure");
 		/* Add a small sleep to increase likelihood of previously
 		 * requested EAP-Failure TX getting out before this should the
diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c
index 958edd3..f414f31 100644
--- a/src/ap/sta_info.c
+++ b/src/ap/sta_info.c
@@ -368,9 +368,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_msg(hapd, MSG_DEBUG,
+			"Timeout, Sending %s info to STA " MACSTR,
+			deauth ? "deauthentication" : "disassociation",
+			MAC2STR(sta->addr));
 
 		if (deauth) {
 			hostapd_drv_sta_deauth(
@@ -410,7 +411,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;
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index e63ee90..8da4d40 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -194,6 +194,9 @@ static void wpa_sta_disconnect(struct wpa_authenticator *wpa_auth,
 {
 	if (wpa_auth->cb.disconnect == NULL)
 		return;
+
+	wpa_msg(NULL, MSG_DEBUG, "wpa_sta_disconnect, STA: " MACSTR,
+		MAC2STR(addr));
 	wpa_auth->cb.disconnect(wpa_auth->cb.ctx, addr,
 				WLAN_REASON_PREV_AUTH_NOT_VALID);
 }
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index d1fdfa8..1dd7a40 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4078,6 +4078,9 @@ static int wpa_driver_nl80211_set_freq(struct wpa_driver_nl80211_data *drv,
 		}
 	}
 
+	wpa_msg(drv->ctx, MSG_DEBUG, "nl80211: Set channel (freq=%d,"
+		" ht-enabled=%d sec-channel-offset=%d)\n",
+		freq, ht_enabled, sec_channel_offset);
 	ret = send_and_recv_msgs(drv, msg, NULL, NULL);
 	if (ret == 0)
 		return 0;
-- 
1.7.3.4




More information about the Hostap mailing list