mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
AP: Pass station P2P PS capabilities info during station add/set
If a legacy client with no P2P PS support is trying to connect to a P2P GO, the driver should know that, and change its PS behavior accordingly. Add a parameter to hostapd_sta_add_params() indicating if P2P PS is supported by the station and pass this parameter to kernel with nl80211 driver when the station is added/set. Signed-off-by: Ayala Beker <ayala.beker@intel.com>
This commit is contained in:
parent
7405bb06ca
commit
ae33239c55
@ -362,7 +362,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
|
|||||||
u16 listen_interval,
|
u16 listen_interval,
|
||||||
const struct ieee80211_ht_capabilities *ht_capab,
|
const struct ieee80211_ht_capabilities *ht_capab,
|
||||||
const struct ieee80211_vht_capabilities *vht_capab,
|
const struct ieee80211_vht_capabilities *vht_capab,
|
||||||
u32 flags, u8 qosinfo, u8 vht_opmode, int set)
|
u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
|
||||||
|
int set)
|
||||||
{
|
{
|
||||||
struct hostapd_sta_add_params params;
|
struct hostapd_sta_add_params params;
|
||||||
|
|
||||||
@ -384,6 +385,7 @@ int hostapd_sta_add(struct hostapd_data *hapd,
|
|||||||
params.vht_opmode = vht_opmode;
|
params.vht_opmode = vht_opmode;
|
||||||
params.flags = hostapd_sta_flags_to_drv(flags);
|
params.flags = hostapd_sta_flags_to_drv(flags);
|
||||||
params.qosinfo = qosinfo;
|
params.qosinfo = qosinfo;
|
||||||
|
params.support_p2p_ps = supp_p2p_ps;
|
||||||
params.set = set;
|
params.set = set;
|
||||||
return hapd->driver->sta_add(hapd->drv_priv, ¶ms);
|
return hapd->driver->sta_add(hapd->drv_priv, ¶ms);
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ int hostapd_sta_add(struct hostapd_data *hapd,
|
|||||||
u16 listen_interval,
|
u16 listen_interval,
|
||||||
const struct ieee80211_ht_capabilities *ht_capab,
|
const struct ieee80211_ht_capabilities *ht_capab,
|
||||||
const struct ieee80211_vht_capabilities *vht_capab,
|
const struct ieee80211_vht_capabilities *vht_capab,
|
||||||
u32 flags, u8 qosinfo, u8 vht_opmode, int set);
|
u32 flags, u8 qosinfo, u8 vht_opmode, int supp_p2p_ps,
|
||||||
|
int set);
|
||||||
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
|
int hostapd_set_privacy(struct hostapd_data *hapd, int enabled);
|
||||||
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
|
int hostapd_set_generic_elem(struct hostapd_data *hapd, const u8 *elem,
|
||||||
size_t elem_len);
|
size_t elem_len);
|
||||||
|
@ -1221,7 +1221,7 @@ static void handle_auth(struct hostapd_data *hapd,
|
|||||||
WLAN_STA_AUTHORIZED);
|
WLAN_STA_AUTHORIZED);
|
||||||
|
|
||||||
if (hostapd_sta_add(hapd, sta->addr, 0, 0, 0, 0, 0,
|
if (hostapd_sta_add(hapd, sta->addr, 0, 0, 0, 0, 0,
|
||||||
NULL, NULL, sta->flags, 0, 0, 0)) {
|
NULL, NULL, sta->flags, 0, 0, 0, 0)) {
|
||||||
hostapd_logger(hapd, sta->addr,
|
hostapd_logger(hapd, sta->addr,
|
||||||
HOSTAPD_MODULE_IEEE80211,
|
HOSTAPD_MODULE_IEEE80211,
|
||||||
HOSTAPD_LEVEL_NOTICE,
|
HOSTAPD_LEVEL_NOTICE,
|
||||||
@ -1805,7 +1805,8 @@ static int add_associated_sta(struct hostapd_data *hapd,
|
|||||||
sta->flags & WLAN_STA_HT ? &ht_cap : NULL,
|
sta->flags & WLAN_STA_HT ? &ht_cap : NULL,
|
||||||
sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
|
sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
|
||||||
sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
|
sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
|
||||||
sta->vht_opmode, sta->added_unassoc)) {
|
sta->vht_opmode, sta->p2p_ie ? 1 : 0,
|
||||||
|
sta->added_unassoc)) {
|
||||||
hostapd_logger(hapd, sta->addr,
|
hostapd_logger(hapd, sta->addr,
|
||||||
HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
|
HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
|
||||||
"Could not %s STA to kernel driver",
|
"Could not %s STA to kernel driver",
|
||||||
|
@ -1419,6 +1419,7 @@ struct hostapd_sta_add_params {
|
|||||||
size_t supp_channels_len;
|
size_t supp_channels_len;
|
||||||
const u8 *supp_oper_classes;
|
const u8 *supp_oper_classes;
|
||||||
size_t supp_oper_classes_len;
|
size_t supp_oper_classes_len;
|
||||||
|
int support_p2p_ps;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mac_address {
|
struct mac_address {
|
||||||
|
@ -3877,6 +3877,13 @@ static int wpa_driver_nl80211_sta_add(void *priv,
|
|||||||
params->ext_capab_len, params->ext_capab))
|
params->ext_capab_len, params->ext_capab))
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_ap_interface(drv->nlmode) &&
|
||||||
|
nla_put_u8(msg, NL80211_ATTR_STA_SUPPORT_P2P_PS,
|
||||||
|
params->support_p2p_ps ?
|
||||||
|
NL80211_P2P_PS_SUPPORTED :
|
||||||
|
NL80211_P2P_PS_UNSUPPORTED))
|
||||||
|
goto fail;
|
||||||
}
|
}
|
||||||
if (!params->set) {
|
if (!params->set) {
|
||||||
if (params->aid) {
|
if (params->aid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user