[PATCH v2 4/5] AP: Restrict Vendor VHT to 2.4 GHz only

Rajkumar Manoharan <[email protected]> Mon, 1 Jun 2020 23:14:27 -0700
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
Vendor VHT IE is used only on 2.4 GHz band. Hence restrict the usage
of vendor VHT element to 2.4 GHz. This will ensure that invalid / wrong
user config will not impact beacon data in other than 2.4 GHz band.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
 src/ap/ieee802_11_vht.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c
index f50f142dc0bb..0d68c8963f90 100644
--- a/src/ap/ieee802_11_vht.c
+++ b/src/ap/ieee802_11_vht.c
@@ -428,6 +428,10 @@ u8 * hostapd_eid_vendor_vht(struct hostapd_data *hapd, u8 *eid)
 	if (!hapd->iface->current_mode)
 		return eid;
 
+	/* Vendor VHT is applicable only to 2.4 GHz */
+	if (hapd->iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
+		return eid;
+
 	*pos++ = WLAN_EID_VENDOR_SPECIFIC;
 	*pos++ = (5 +		/* The Vendor OUI, type and subtype */
 		  2 + sizeof(struct ieee80211_vht_capabilities) +
-- 
2.7.4