aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-03-08 20:41:17 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-11 08:52:43 (GMT)
commit15e5ee0b7559c9d7357a7c5b4f50f2f34b209ad1 (patch)
tree819c7786b78c15984557b961bc27b782a61f74bc /wpa_supplicant/events.c
parentbe607ceb556153da45fd27b3978c7bae1f1e6ef1 (diff)
downloadhostap-15e5ee0b7559c9d7357a7c5b4f50f2f34b209ad1.zip
hostap-15e5ee0b7559c9d7357a7c5b4f50f2f34b209ad1.tar.gz
hostap-15e5ee0b7559c9d7357a7c5b4f50f2f34b209ad1.tar.bz2
wpa_supplicant: events: Don't bounce timeout reason through a buffer
There's no point in making the code use a stack buffer and first copying the string there, only to copy it again to the output. Make the output directly use the reason string. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 500c285..11cab65 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3618,7 +3618,6 @@ 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 &&
@@ -3787,24 +3786,23 @@ 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%s",
+ "bssid=" MACSTR " status_code=%u%s%s%s",
MAC2STR(data->assoc_reject.bssid),
data->assoc_reject.status_code,
data->assoc_reject.timed_out ? " timeout" : "",
- buf);
+ data->assoc_reject.timeout_reason ? "=" : "",
+ data->assoc_reject.timeout_reason ?
+ data->assoc_reject.timeout_reason : "");
else
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_ASSOC_REJECT
- "status_code=%u%s%s",
+ "status_code=%u%s%s%s",
data->assoc_reject.status_code,
data->assoc_reject.timed_out ? " timeout" : "",
- buf);
+ data->assoc_reject.timeout_reason ? "=" : "",
+ data->assoc_reject.timeout_reason ?
+ data->assoc_reject.timeout_reason : "");
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)