From e2fc13d0ab3b97c7f097b5e5329a9740aaf2f8fc Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Thu, 7 Dec 2017 09:14:49 -0800 Subject: [PATCH] hostapd: Add logging around Michael MIC related failures This can help one understand better why stations are failing to authentication/associate. Signed-off-by: Ben Greear --- src/ap/ieee802_11.c | 2 ++ src/ap/tkip_countermeasures.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 3fe8af0ce..4394d37bf 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -1729,6 +1729,8 @@ static void handle_auth(struct hostapd_data *hapd, #endif /* CONFIG_NO_RC4 */ if (hapd->tkip_countermeasures) { + wpa_printf(MSG_DEBUG, + "Ongoing TKIP countermeasures (Michael MIC failure) - reject authentication"); resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } diff --git a/src/ap/tkip_countermeasures.c b/src/ap/tkip_countermeasures.c index 4725e2b3e..557570cd1 100644 --- a/src/ap/tkip_countermeasures.c +++ b/src/ap/tkip_countermeasures.c @@ -71,6 +71,11 @@ int michael_mic_failure(struct hostapd_data *hapd, const u8 *addr, int local) struct os_reltime now; int ret = 0; + hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_INFO, + "Michael MIC failure detected in received frame%s", + local ? " (local)" : ""); + if (addr && local) { struct sta_info *sta = ap_get_sta(hapd, addr); if (sta != NULL) {