aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorPurushottam Kushwaha <pkushwah@qti.qualcomm.com>2017-02-16 09:23:00 (GMT)
committerJouni Malinen <j@w1.fi>2017-02-20 08:47:08 (GMT)
commit3f23260da89a2b4517b67a4ca8b39df5f0d27eab (patch)
tree709b44701943ddb93a99f9f1df5fdfb008cf125c /wpa_supplicant/events.c
parentca1ab9db2a9e817e528aeb448d0aab4b63a6f61c (diff)
downloadhostap-3f23260da89a2b4517b67a4ca8b39df5f0d27eab.zip
hostap-3f23260da89a2b4517b67a4ca8b39df5f0d27eab.tar.gz
hostap-3f23260da89a2b4517b67a4ca8b39df5f0d27eab.tar.bz2
nl80211: Notify reason for connection timeout failure
This adds reason for timeout in event CTRL-EVENT-ASSOC-REJECT whenever connection failure happens because of timeout. This extends the "timeout" parameter in the event to include the reason, if available: timeout=scan, timeout=auth, timeout=assoc. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 24dbd3e..448615e 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3618,6 +3618,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
union wpa_event_data *data)
{
struct wpa_supplicant *wpa_s = ctx;
+ char buf[100];
int resched;
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED &&
@@ -3786,17 +3787,24 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
break;
#endif /* CONFIG_IBSS_RSN */
case EVENT_ASSOC_REJECT:
+ if (data->assoc_reject.timeout_reason)
+ os_snprintf(buf, sizeof(buf), "=%s",
+ data->assoc_reject.timeout_reason);
+ else
+ buf[0] = '\0';
if (data->assoc_reject.bssid)
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_ASSOC_REJECT
- "bssid=" MACSTR " status_code=%u%s",
+ "bssid=" MACSTR " status_code=%u%s%s",
MAC2STR(data->assoc_reject.bssid),
data->assoc_reject.status_code,
- data->assoc_reject.timed_out ? " timeout" : "");
+ data->assoc_reject.timed_out ? " timeout" : "",
+ buf);
else
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_ASSOC_REJECT
- "status_code=%u%s",
+ "status_code=%u%s%s",
data->assoc_reject.status_code,
- data->assoc_reject.timed_out ? " timeout" : "");
+ data->assoc_reject.timed_out ? " timeout" : "",
+ buf);
wpa_s->assoc_status_code = data->assoc_reject.status_code;
wpas_notify_assoc_status_code(wpa_s);
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)