]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Allow specific link BSS to be found with bss_find_mld()
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 25 Aug 2023 08:19:24 +0000 (11:19 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 25 Aug 2023 08:19:24 +0000 (11:19 +0300)
Make this function more capable to address cases where a specific
affiliated link of an AP MLD needs to be found.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wlantest/bss.c
wlantest/rx_mgmt.c
wlantest/wlantest.h

index 64e4421ae3a803612d2486b562a423265e76c37f..01c9c624273958d785c864b8855d9c9ea531c046 100644 (file)
@@ -29,12 +29,15 @@ struct wlantest_bss * bss_find(struct wlantest *wt, const u8 *bssid)
 }
 
 
-struct wlantest_bss * bss_find_mld(struct wlantest *wt, const u8 *mld_mac_addr)
+struct wlantest_bss * bss_find_mld(struct wlantest *wt, const u8 *mld_mac_addr,
+                                  int link_id)
 {
        struct wlantest_bss *bss;
 
        dl_list_for_each(bss, &wt->bss, struct wlantest_bss, list) {
-               if (os_memcmp(bss->mld_mac_addr, mld_mac_addr, ETH_ALEN) == 0)
+               if (os_memcmp(bss->mld_mac_addr, mld_mac_addr, ETH_ALEN) == 0 &&
+                   (link_id < 0 ||
+                    (bss->link_id_set && bss->link_id == link_id)))
                        return bss;
        }
 
index c4fc06a9782bb143a9264f104f5546bb26145ad0..82a2255c22c34289d611172c098ca647584c76d9 100644 (file)
@@ -2138,7 +2138,7 @@ static void rx_mgmt_action_ft_request(struct wlantest *wt,
        }
 
        bss = bss_find(wt, aa);
-       bss2 = bss_find_mld(wt, aa);
+       bss2 = bss_find_mld(wt, aa, -1);
        if (!bss)
                bss = bss2;
        if (bss && bss2 && bss != bss2 && !sta_find(bss, spa))
@@ -2199,7 +2199,7 @@ static void rx_mgmt_action_ft_response(struct wlantest *wt,
        }
 
        bss = bss_find(wt, aa);
-       bss2 = bss_find_mld(wt, aa);
+       bss2 = bss_find_mld(wt, aa, -1);
        if (!bss)
                bss = bss2;
        if (bss && bss2 && bss != bss2 && !sta_find(bss, spa))
index 3668c753fa207e8e6940f4b330cdd148ab603b15..65ae74cb4316bb0d10463d74d6413bb479959a35 100644 (file)
@@ -296,7 +296,8 @@ void rx_data_80211_encap(struct wlantest *wt, const u8 *bssid,
                         const u8 *data, size_t len);
 
 struct wlantest_bss * bss_find(struct wlantest *wt, const u8 *bssid);
-struct wlantest_bss * bss_find_mld(struct wlantest *wt, const u8 *mld_mac_addr);
+struct wlantest_bss * bss_find_mld(struct wlantest *wt, const u8 *mld_mac_addr,
+                                  int link_id);
 struct wlantest_bss * bss_get(struct wlantest *wt, const u8 *bssid);
 void bss_deinit(struct wlantest_bss *bss);
 void bss_update(struct wlantest *wt, struct wlantest_bss *bss,