hostapd: Add require_ht configuration parameter
This can be used to configure hostapd to reject association with any station that does not support HT PHY.
This commit is contained in:
parent
e67b55fb11
commit
2944824315
6 changed files with 31 additions and 3 deletions
|
@ -53,6 +53,8 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
|||
|
||||
*pos++ = WLAN_EID_SUPP_RATES;
|
||||
num = hapd->iface->num_rates;
|
||||
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht)
|
||||
num++;
|
||||
if (num > 8) {
|
||||
/* rest of the rates are encoded in Extended supported
|
||||
* rates element */
|
||||
|
@ -70,6 +72,10 @@ u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
|||
pos++;
|
||||
}
|
||||
|
||||
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht &&
|
||||
hapd->iface->num_rates < 8)
|
||||
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY;
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
@ -83,6 +89,8 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
|||
return eid;
|
||||
|
||||
num = hapd->iface->num_rates;
|
||||
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht)
|
||||
num++;
|
||||
if (num <= 8)
|
||||
return eid;
|
||||
num -= 8;
|
||||
|
@ -101,6 +109,10 @@ u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid)
|
|||
pos++;
|
||||
}
|
||||
|
||||
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht &&
|
||||
hapd->iface->num_rates >= 8)
|
||||
*pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY;
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
@ -667,6 +679,13 @@ static u16 check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
|
|||
elems.ht_capabilities_len);
|
||||
if (resp != WLAN_STATUS_SUCCESS)
|
||||
return resp;
|
||||
if (hapd->iconf->ieee80211n && hapd->iconf->require_ht &&
|
||||
!(sta->flags & WLAN_STA_HT)) {
|
||||
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
|
||||
HOSTAPD_LEVEL_INFO, "Station does not support "
|
||||
"mandatory HT PHY - reject association");
|
||||
return WLAN_STATUS_ASSOC_DENIED_NO_HT;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211N */
|
||||
|
||||
if ((hapd->conf->wpa & WPA_PROTO_RSN) && elems.rsn_ie) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue