]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
wifi: mac80211_hwsim: Ack link addressed frames
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Wed, 22 Jun 2022 12:02:37 +0000 (15:02 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 15 Jul 2022 09:43:14 +0000 (11:43 +0200)
Do address matching with link addresses as well.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/mac80211_hwsim.c

index 6bad95eeb709741080a939d5abeb8172bf675b02..737f8ed56d9438a034e98277ba275f862b7d68b3 100644 (file)
@@ -1198,10 +1198,27 @@ struct mac80211_hwsim_addr_match_data {
 static void mac80211_hwsim_addr_iter(void *data, u8 *mac,
                                     struct ieee80211_vif *vif)
 {
+       int i;
        struct mac80211_hwsim_addr_match_data *md = data;
 
-       if (memcmp(mac, md->addr, ETH_ALEN) == 0)
+       if (memcmp(mac, md->addr, ETH_ALEN) == 0) {
                md->ret = true;
+               return;
+       }
+
+       /* Match the link address */
+       for (i = 0; i < ARRAY_SIZE(vif->link_conf); i++) {
+               struct ieee80211_bss_conf *conf;
+
+               conf = rcu_dereference(vif->link_conf[i]);
+               if (!conf)
+                       continue;
+
+               if (memcmp(conf->addr, md->addr, ETH_ALEN) == 0) {
+                       md->ret = true;
+                       return;
+               }
+       }
 }
 
 static bool mac80211_hwsim_addr_match(struct mac80211_hwsim_data *data,