From 0da355235e4752e0bed46ca617d752de656a5784 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 29 Jan 2017 19:22:14 +0200 Subject: [PATCH] FST: Remove WPA_ASSERT from wpas_fst_send_action_cb() It was possible to hit this WPA_ASSERT when FST-MANAGER SESSION_REMOVE command is exececuted when in not-associated state. In CONFIG_EAPOL_TEST=y builds, this would result in the wpa_supplicant process being terminated. Convert this WPA_ASSERT to a check that does not terminate the process, but only rejects the command if wpa_s->bssid does not match the da argument. Signed-off-by: Jouni Malinen --- wpa_supplicant/wpa_supplicant.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index e48439bde..742aa1f0b 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -4162,10 +4162,14 @@ static int wpas_fst_send_action_cb(void *ctx, const u8 *da, struct wpabuf *data) { struct wpa_supplicant *wpa_s = ctx; - WPA_ASSERT(os_memcmp(wpa_s->bssid, da, ETH_ALEN) == 0); + if (os_memcmp(wpa_s->bssid, da, ETH_ALEN) != 0) { + wpa_printf(MSG_INFO, "FST:%s:bssid=" MACSTR " != da=" MACSTR, + __func__, MAC2STR(wpa_s->bssid), MAC2STR(da)); + return -1; + } return wpa_drv_send_action(wpa_s, wpa_s->assoc_freq, 0, wpa_s->bssid, - wpa_s->own_addr, wpa_s->bssid, - wpabuf_head(data), wpabuf_len(data), + wpa_s->own_addr, wpa_s->bssid, + wpabuf_head(data), wpabuf_len(data), 0); }