]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Verify Beacon frame MME even after Probe Response reception
authorJouni Malinen <quic_jouni@quicinc.com>
Wed, 28 Sep 2022 20:02:31 +0000 (23:02 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 28 Sep 2022 20:02:31 +0000 (23:02 +0300)
rx_mgmt_beacon() was skipping all steps after a Probe Response frame
from the AP had been processed. This is expected for the parts that were
updating the bss entry information, but the checks for beacon protection
should not be skipped in this manner.

Skip onlu the updating parts while checking that beacon protection is
used correctly to make this more useful.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wlantest/rx_mgmt.c

index 1d0aef6abc9e487aaed5c94f9e299efa1b0fce77..3372fd7081cfd26fe1a931e4943446cee62fdeed 100644 (file)
@@ -75,9 +75,9 @@ static void rx_mgmt_beacon(struct wlantest *wt, const u8 *data, size_t len)
        bss = bss_get(wt, mgmt->bssid);
        if (bss == NULL)
                return;
-       if (bss->proberesp_seen)
-               return; /* do not override with Beacon data */
-       bss->capab_info = le_to_host16(mgmt->u.beacon.capab_info);
+       /* do not override with Beacon data */
+       if (!bss->proberesp_seen)
+               bss->capab_info = le_to_host16(mgmt->u.beacon.capab_info);
        if (ieee802_11_parse_elems(mgmt->u.beacon.variable, len - offset,
                                   &elems, 0) == ParseFailed) {
                if (bss->parse_error_reported)
@@ -88,7 +88,8 @@ static void rx_mgmt_beacon(struct wlantest *wt, const u8 *data, size_t len)
                return;
        }
 
-       bss_update(wt, bss, &elems, 1);
+       if (!bss->proberesp_seen)
+               bss_update(wt, bss, &elems, 1);
 
        mme = get_ie(mgmt->u.beacon.variable, len - offset, WLAN_EID_MMIE);
        if (!mme) {