[PATCH 2/8] WNM: Allow frames from AP MLD

Andrei Otcheretianski andrei.otcheretianski at intel.com
Wed Dec 13 06:04:06 PST 2023


From: Ilan Peer <ilan.peer at intel.com>

Allow frames where the DA is the AP MLD address as the driver might
have performed address translation.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 wpa_supplicant/wnm_sta.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c
index ccfc34d20b..493821b37f 100644
--- a/wpa_supplicant/wnm_sta.c
+++ b/wpa_supplicant/wnm_sta.c
@@ -1878,7 +1878,8 @@ static void ieee802_11_rx_wnm_notif_req(struct wpa_supplicant *wpa_s,
 		    pos, end - pos);
 
 	if (wpa_s->wpa_state != WPA_COMPLETED ||
-	    os_memcmp(sa, wpa_s->bssid, ETH_ALEN) != 0) {
+	    (os_memcmp(sa, wpa_s->bssid, ETH_ALEN) &&
+	     os_memcmp(sa, wpa_s->ap_mld_addr, ETH_ALEN))) {
 		wpa_dbg(wpa_s, MSG_DEBUG, "WNM: WNM-Notification frame not "
 			"from our AP - ignore it");
 		return;
@@ -1922,7 +1923,8 @@ static void ieee802_11_rx_wnm_coloc_intf_req(struct wpa_supplicant *wpa_s,
 		return; /* only nonzero values are used for request */
 
 	if (wpa_s->wpa_state != WPA_COMPLETED ||
-	    os_memcmp(sa, wpa_s->bssid, ETH_ALEN) != 0) {
+	    (os_memcmp(sa, wpa_s->bssid, ETH_ALEN) &&
+	     os_memcmp(sa, wpa_s->ap_mld_addr, ETH_ALEN))) {
 		wpa_dbg(wpa_s, MSG_DEBUG,
 			"WNM: Collocated Interference Request frame not from current AP - ignore it");
 		return;
@@ -1952,9 +1954,10 @@ void ieee802_11_rx_wnm_action(struct wpa_supplicant *wpa_s,
 	wpa_printf(MSG_DEBUG, "WNM: RX action %u from " MACSTR,
 		   act, MAC2STR(mgmt->sa));
 	if (wpa_s->wpa_state < WPA_ASSOCIATED ||
-	    os_memcmp(mgmt->sa, wpa_s->bssid, ETH_ALEN) != 0) {
-		wpa_printf(MSG_DEBUG, "WNM: Ignore unexpected WNM Action "
-			   "frame");
+	    (os_memcmp(mgmt->sa, wpa_s->bssid, ETH_ALEN) &&
+	     os_memcmp(mgmt->sa, wpa_s->ap_mld_addr, ETH_ALEN))) {
+		wpa_printf(MSG_DEBUG,
+			   "WNM: Ignore unexpected WNM Action frame");
 		return;
 	}
 
-- 
2.38.1




More information about the Hostap mailing list