]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EHT: Validate the puncturing bitmap for ACS
authorAloka Dixit <quic_alokad@quicinc.com>
Tue, 14 Mar 2023 04:59:25 +0000 (21:59 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 17 Mar 2023 17:49:57 +0000 (19:49 +0200)
Validate the generated puncturing bitmap against non-OFDMA patterns.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
src/ap/acs.c

index 99973f140b221e8eb640673bafb5bc27b645f33a..1181c7d58e0ee60a0ca5f9ecc063048a5ce72bbb 100644 (file)
@@ -722,7 +722,7 @@ static void acs_update_puncturing_bitmap(struct hostapd_iface *iface,
                                         int index_primary)
 {
        struct hostapd_config *conf = iface->conf;
-       struct hostapd_channel_data *adj_chan = NULL;
+       struct hostapd_channel_data *adj_chan = NULL, *first_chan = chan;
        int i;
        long double threshold;
 
@@ -754,9 +754,16 @@ static void acs_update_puncturing_bitmap(struct hostapd_iface *iface,
                        return;
                }
 
+               if (i == 0)
+                       first_chan = adj_chan;
+
                if (adj_chan->interference_factor > threshold)
                        chan->punct_bitmap |= BIT(i);
        }
+
+       if (!is_punct_bitmap_valid(bw, (chan->freq - first_chan->freq) / 20,
+                                  chan->punct_bitmap))
+               chan->punct_bitmap = 0;
 }
 #endif /* CONFIG_IEEE80211BE */