]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mac80211_hwsim: Fix MLD address translation
authorIlan Peer <ilan.peer@intel.com>
Sat, 8 Mar 2025 21:03:34 +0000 (23:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:12:48 +0000 (11:12 +0200)
[ Upstream commit 65bff0be9b154621b617fc2e4bd89f1e18e97cdb ]

Do address translations only between shared links. It is
possible that while an non-AP MLD station and an AP MLD
station have shared links, the frame is intended to be sent
on a link which is not shared (for example when sending a
probe response).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.1aa461270bb6.Ic21592e1b1634653f02b80628cb2152f6e9de367@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/virtual/mac80211_hwsim.c

index cf6a331d404271141f3e9a736feba1ad8cfead5a..a68530344d205c67a280fb5138da58edf8d858e4 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (c) 2008, Jouni Malinen <j@w1.fi>
  * Copyright (c) 2011, Javier Lopez <jlopex@gmail.com>
  * Copyright (c) 2016 - 2017 Intel Deutschland GmbH
- * Copyright (C) 2018 - 2024 Intel Corporation
+ * Copyright (C) 2018 - 2025 Intel Corporation
  */
 
 /*
@@ -1983,11 +1983,13 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
                        return;
                }
 
-               if (sta && sta->mlo) {
-                       if (WARN_ON(!link_sta)) {
-                               ieee80211_free_txskb(hw, skb);
-                               return;
-                       }
+               /* Do address translations only between shared links. It is
+                * possible that while an non-AP MLD station and an AP MLD
+                * station have shared links, the frame is intended to be sent
+                * on a link which is not shared (for example when sending a
+                * probe response).
+                */
+               if (sta && sta->mlo && link_sta) {
                        /* address translation to link addresses on TX */
                        ether_addr_copy(hdr->addr1, link_sta->addr);
                        ether_addr_copy(hdr->addr2, bss_conf->addr);