wlantest: Search for FT Target AP using MLD MAC address as well

When FT over-the-DS is used with MLO, the Target AP Address field is
expected to identify the AP MLD using its MLD MAC address.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2023-08-10 11:42:06 +03:00 committed by Jouni Malinen
parent 49bf9f2df9
commit 5434a42ec6
3 changed files with 25 additions and 2 deletions

View file

@ -29,6 +29,19 @@ 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;
dl_list_for_each(bss, &wt->bss, struct wlantest_bss, list) {
if (os_memcmp(bss->mld_mac_addr, mld_mac_addr, ETH_ALEN) == 0)
return bss;
}
return NULL;
}
struct wlantest_bss * bss_get(struct wlantest *wt, const u8 *bssid) struct wlantest_bss * bss_get(struct wlantest *wt, const u8 *bssid)
{ {
struct wlantest_bss *bss; struct wlantest_bss *bss;

View file

@ -2084,7 +2084,7 @@ static void rx_mgmt_action_ft_response(struct wlantest *wt,
const struct ieee80211_mgmt *mgmt, const struct ieee80211_mgmt *mgmt,
size_t len) size_t len)
{ {
struct wlantest_bss *bss; struct wlantest_bss *bss, *bss2;
struct wlantest_sta *new_sta; struct wlantest_sta *new_sta;
const u8 *ies; const u8 *ies;
size_t ies_len; size_t ies_len;
@ -2113,7 +2113,16 @@ static void rx_mgmt_action_ft_response(struct wlantest *wt,
return; return;
} }
bss = bss_get(wt, mgmt->u.action.u.ft_action_resp.target_ap_addr); bss = bss_find(wt, mgmt->u.action.u.ft_action_resp.target_ap_addr);
bss2 = bss_find_mld(wt, mgmt->u.action.u.ft_action_resp.target_ap_addr);
if (!bss)
bss = bss2;
if (bss && bss2 && bss != bss2 && !sta_find(bss, sta->addr))
bss = bss2;
if (!bss)
bss = bss_get(wt,
mgmt->u.action.u.ft_action_resp.target_ap_addr);
if (!bss) { if (!bss) {
add_note(wt, MSG_INFO, "No BSS entry for Target AP"); add_note(wt, MSG_INFO, "No BSS entry for Target AP");
return; return;

View file

@ -294,6 +294,7 @@ void rx_data_80211_encap(struct wlantest *wt, const u8 *bssid,
const u8 *data, size_t len); const u8 *data, size_t len);
struct wlantest_bss * bss_find(struct wlantest *wt, const u8 *bssid); 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_get(struct wlantest *wt, const u8 *bssid); struct wlantest_bss * bss_get(struct wlantest *wt, const u8 *bssid);
void bss_deinit(struct wlantest_bss *bss); void bss_deinit(struct wlantest_bss *bss);
void bss_update(struct wlantest *wt, struct wlantest_bss *bss, void bss_update(struct wlantest *wt, struct wlantest_bss *bss,