From 3a9fdac9beb550fb4ac2109dbc9fa3b83803f94d Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Mon, 31 Jan 2011 11:55:18 -0800 Subject: [PATCH 10/17] hostap: Ensure debug messages for all PREV_AUTH_NOT_VALID uses. Signed-off-by: Ben Greear --- :100644 100644 195b8a7... f66204b... M hostapd/ctrl_iface.c :100644 100644 f00a544... 12c1db2... M src/ap/hostapd.c :100644 100644 6b6fd4b... eea4a89... M src/ap/ieee802_1x.c :100644 100644 e829447... 8d7740a... M src/ap/sta_info.c :100644 100644 3fbb88b... 2fcca41... M src/ap/wpa_auth.c :100644 100644 51f38b0... 83331a8... M src/drivers/driver_nl80211.c hostapd/ctrl_iface.c | 10 +++++----- src/ap/hostapd.c | 2 +- src/ap/ieee802_1x.c | 7 +++++-- src/ap/sta_info.c | 9 +++++---- src/ap/wpa_auth.c | 3 +++ src/drivers/driver_nl80211.c | 3 +++ 6 files changed, 22 insertions(+), 12 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 f00a544..12c1db2 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -346,7 +346,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 6b6fd4b..eea4a89 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -1410,6 +1410,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); @@ -2073,8 +2076,8 @@ static void ieee802_1x_finished(struct hostapd_data *hapd, * and some may not be be able to do that themselves, so * disconnect the client here. */ - wpa_printf(MSG_DEBUG, "WPS: Force disconnection after " - "EAP-Failure"); + wpa_msg(hapd, MSG_DEBUG, "WPS: Force disconnection after " + "EAP-Failure"); /* Add a small sleep to increase likelihood of previously * requested EAP-Failure TX getting out before this should the * driver reorder operations. diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index e829447..8d7740a 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -351,9 +351,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( @@ -393,7 +394,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 3fbb88b..2fcca41 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 51f38b0..83331a8 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3706,6 +3706,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