]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Allow missing RSNE in S1G beacon
authorThomas Pedersen <thomas@adapt-ip.com>
Thu, 22 Oct 2020 18:20:32 +0000 (11:20 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 4 Dec 2020 10:01:54 +0000 (12:01 +0200)
S1G beacons save a few bytes by not requiring the RSNE in beacon if RSN
BSS is configured. Handle this in wlantest by only clearing RSNE from
the BSS info if frame is a Probe Response frame.

Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
src/common/ieee802_11_common.c
src/common/ieee802_11_common.h
src/common/ieee802_11_defs.h
wlantest/bss.c

index 8bdeeb5a45452b94db2a7e3a44b289da85975299..531def45871d1e4d4429363e521c15973db30d6a 100644 (file)
@@ -566,6 +566,11 @@ ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
                        elems->dils = pos;
                        elems->dils_len = elen;
                        break;
+               case WLAN_EID_S1G_CAPABILITIES:
+                       if (elen < 15)
+                               break;
+                       elems->s1g_capab = pos;
+                       break;
                case WLAN_EID_FRAGMENT:
                        ieee802_11_parse_fragment(&elems->frag_ies, pos, elen);
                        break;
index 0ae0fa4d1b2b0fae828ef738a5b384f21c378185..473e00cfdd4d131164403d71e1746d694669eb0f 100644 (file)
@@ -115,6 +115,7 @@ struct ieee802_11_elems {
        const u8 *short_ssid_list;
        const u8 *he_6ghz_band_cap;
        const u8 *sae_pk;
+       const u8 *s1g_capab;
 
        u8 ssid_len;
        u8 supp_rates_len;
index 86d71c15680d595fa1f34fe83b720c3dc9d1c52e..9518a7afe909cf5cd78d6892e1d3d65b883f5e2b 100644 (file)
 #define WLAN_EID_DEVICE_LOCATION 204
 #define WLAN_EID_WHITE_SPACE_MAP 205
 #define WLAN_EID_FTM_PARAMETERS 206
+#define WLAN_EID_S1G_BCN_COMPAT 213
+#define WLAN_EID_S1G_CAPABILITIES 217
 #define WLAN_EID_VENDOR_SPECIFIC 221
+#define WLAN_EID_S1G_OPERATION 232
 #define WLAN_EID_CAG_NUMBER 237
 #define WLAN_EID_AP_CSN 239
 #define WLAN_EID_FILS_INDICATION 240
index 3208e65e4195d5b69aafca51e4d2e6586aedc3e8..92f4a5ebc6b36b9c7266ed67c4eb6e465ca96bcd 100644 (file)
@@ -178,14 +178,18 @@ void bss_update(struct wlantest *wt, struct wlantest_bss *bss,
                          elems->osen_len + 2);
        }
 
-       if (elems->rsn_ie == NULL) {
+       /* S1G does not include RSNE in beacon, so only clear it from
+        * Probe Response frames. Note this assumes short beacons were dropped
+        * due to missing SSID above.
+        */
+       if (!elems->rsn_ie && (!elems->s1g_capab || beacon != 1)) {
                if (bss->rsnie[0]) {
                        add_note(wt, MSG_INFO, "BSS " MACSTR
                                 " - RSN IE removed", MAC2STR(bss->bssid));
                        bss->rsnie[0] = 0;
                        update = 1;
                }
-       } else {
+       } else if (elems->rsn_ie) {
                if (bss->rsnie[0] == 0 ||
                    os_memcmp(bss->rsnie, elems->rsn_ie - 2,
                              elems->rsn_ie_len + 2) != 0) {