]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Swap logic in wnm_is_bss_excluded() to allow more checks
authorBenjamin Berg <benjamin.berg@intel.com>
Mon, 29 Apr 2024 11:51:47 +0000 (13:51 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 2 Aug 2024 09:58:27 +0000 (12:58 +0300)
Following commits will move more checks into wnm_is_bss_excluded().
Prepare for that by changing the logical flow so that further checks can
be inserted.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
wpa_supplicant/wnm_sta.c

index 8cd43840059ae324b7238acd807e2bc9fa6105b7..613223f77828b6b9c88cc7b6f5cdfcdef19fdf69 100644 (file)
@@ -2057,19 +2057,20 @@ void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s)
 
 bool wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
 {
-       if (!(wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT))
-               return false;
-
        /*
         * In case disassociation imminent is set, do no try to use a BSS to
         * which we are connected.
         */
-       if (!wpa_s->wnm_disassoc_mld) {
-               if (ether_addr_equal(bss->bssid, wpa_s->wnm_disassoc_addr))
-                       return true;
-       } else {
-               if (ether_addr_equal(bss->mld_addr, wpa_s->wnm_disassoc_addr))
-                       return true;
+       if (wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT) {
+               if (!wpa_s->wnm_disassoc_mld) {
+                       if (ether_addr_equal(bss->bssid,
+                                            wpa_s->wnm_disassoc_addr))
+                               return true;
+               } else {
+                       if (ether_addr_equal(bss->mld_addr,
+                                            wpa_s->wnm_disassoc_addr))
+                               return true;
+               }
        }
 
        return false;