From 6453130231e0e7012daf59566c2628a88974d084 Mon Sep 17 00:00:00 2001 From: Hari Chandrakanthan Date: Thu, 20 Apr 2023 21:45:58 +0530 Subject: [PATCH] hostapd : fix DS parameter in beacon and probe response Few clients refuse to connect to the 6 GHz AP when the AP is brought up in non-psc channel. The clients receive the duplicate beacons of the AP in the psc-channel and drops the beacon due to the DS parameter available in the beacon. From IEEE Std 802.11-2020 9.3.3.2 Beacon frame format, DSSS Parameter Set: The element is optionally present. The DSSS Parameter Set element is present within Beacon frames generated by STAs using Clause 15, Clause 16, and Clause 18 PHYs. The element is present within Beacon frames generated by STAs using a Clause 19 PHY in the 2.4 GHz band. The mentioned clauses point to 2.4 GHz PHYs. DSSS : Direct Sequence Spread Spectrum As the standard mentions that DS parameter is applicable only to 2.4 GHz band, add a check to include this parameter only to that band in the beacons and probe response of the AP. Signed-off-by: Hari Chandrakanthan --- src/ap/beacon.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 24abf52..33be2ac 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -87,6 +87,11 @@ static u8 ieee802_11_erp_info(struct hostapd_data *hapd) static u8 * hostapd_eid_ds_params(struct hostapd_data *hapd, u8 *eid) { + if (hapd->iface->current_mode == NULL || + (hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G && + hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211B)) + return eid; + *eid++ = WLAN_EID_DS_PARAMS; *eid++ = 1; *eid++ = hapd->iconf->channel;