]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FST: Remove WPA_ASSERT from wpas_fst_send_action_cb()
authorJouni Malinen <j@w1.fi>
Sun, 29 Jan 2017 17:22:14 +0000 (19:22 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Jan 2017 17:22:14 +0000 (19:22 +0200)
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 <j@w1.fi>
wpa_supplicant/wpa_supplicant.c

index e48439bde1327eb474e389753df1c8c22e7ae550..742aa1f0b9bd342558805ea846738283beb88231 100644 (file)
@@ -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);
 }