diff --git a/wlantest/bss.c b/wlantest/bss.c index 64e4421ae..01c9c6242 100644 --- a/wlantest/bss.c +++ b/wlantest/bss.c @@ -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; } diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c index c4fc06a97..82a2255c2 100644 --- a/wlantest/rx_mgmt.c +++ b/wlantest/rx_mgmt.c @@ -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)) diff --git a/wlantest/wlantest.h b/wlantest/wlantest.h index 3668c753f..65ae74cb4 100644 --- a/wlantest/wlantest.h +++ b/wlantest/wlantest.h @@ -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,