wifi: mac80211: fix supported rate masking in scan
authorJohannes Berg <johannes.berg@intel.com>
Fri, 1 Mar 2024 16:54:51 +0000 (17:54 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 4 Mar 2024 13:24:27 +0000 (14:24 +0100)
We have an nl80211 attribute to mask supported rates from
probe responses in scanning, e.g. for use in P2P, but in
the refactoring I stopped applying this mask. Restore it.

Fixes: 07095d167749 ("wifi: mac80211: start building elements in SKBs")
Link: https://msgid.link/20240301175451.7ad8ab0bd90c.I46b49e4fc27fe60b75d4559c01104e55ed381c37@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/util.c

index 627bd5a8bda5289aa4cbe400709219aa5b0fc560..f810b83a390afe9cc19067471dbcf7f5f0ceb06b 100644 (file)
@@ -1216,8 +1216,8 @@ static int ieee80211_put_preq_ies_band(struct sk_buff *skb,
        if (band == NL80211_BAND_S1GHZ)
                return ieee80211_put_s1g_cap(skb, &sband->s1g_cap);
 
-       err = ieee80211_put_srates_elem(skb, sband, 0, rate_flags, 0,
-                                       WLAN_EID_SUPP_RATES);
+       err = ieee80211_put_srates_elem(skb, sband, 0, rate_flags,
+                                       ~rate_mask, WLAN_EID_SUPP_RATES);
        if (err)
                return err;
 
@@ -1238,8 +1238,8 @@ static int ieee80211_put_preq_ies_band(struct sk_buff *skb,
                *offset = noffset;
        }
 
-       err = ieee80211_put_srates_elem(skb, sband, 0, rate_flags, 0,
-                                       WLAN_EID_EXT_SUPP_RATES);
+       err = ieee80211_put_srates_elem(skb, sband, 0, rate_flags,
+                                       ~rate_mask, WLAN_EID_EXT_SUPP_RATES);
        if (err)
                return err;