From: Narasimha Rao PVS Date: Thu, 3 Feb 2022 08:03:45 +0000 (+0000) Subject: OCV: Don't start SA Query timer on CSA when SA Query is offloaded X-Git-Tag: hostap_2_11~2243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a91072503ca7ded1316ad9d7dd5510763077c095;p=thirdparty%2Fhostap.git OCV: Don't start SA Query timer on CSA when SA Query is offloaded Check driver support for SA Query offload in AP mode and skip starting SA Query timer on CSA for OCV enabled STAs when the driver indicates support for offloading SA Query procedures. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index a50e6f2af..d97b3535b 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -1011,7 +1011,9 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht, hostapd_neighbor_set_own_report(hapd->iface->bss[i]); #ifdef CONFIG_OCV - if (hapd->conf->ocv) { + if (hapd->conf->ocv && + !(hapd->iface->drv_flags2 & + WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP)) { struct sta_info *sta; bool check_sa_query = false; diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 85be4c384..ebc550fbe 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -2027,6 +2027,8 @@ struct wpa_driver_capa { #define WPA_DRIVER_FLAGS2_OCV 0x0000000000000080ULL /** Driver expects user space implementation of SME in AP mode */ #define WPA_DRIVER_FLAGS2_AP_SME 0x0000000000000100ULL +/** Driver handles SA Query procedures in AP mode */ +#define WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP 0x0000000000000200ULL u64 flags2; #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \ diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 145f2f0d9..40b3e1b5c 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4656,10 +4656,24 @@ static int wpa_driver_nl80211_set_ap(void *priv, nla_put_flag(msg, NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT))) goto fail; - if (drv->device_ap_sme && - (params->key_mgmt_suites & WPA_KEY_MGMT_SAE) && - nla_put_flag(msg, NL80211_ATTR_EXTERNAL_AUTH_SUPPORT)) - goto fail; + if (drv->device_ap_sme) { + u32 flags = 0; + + if (params->key_mgmt_suites & WPA_KEY_MGMT_SAE) { + /* Add the previously used flag attribute to support + * older kernel versions and the newer flag bit for + * newer kernels. */ + if (nla_put_flag(msg, + NL80211_ATTR_EXTERNAL_AUTH_SUPPORT)) + goto fail; + flags |= NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT; + } + + flags |= NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT; + + if (nla_put_u32(msg, NL80211_ATTR_AP_SETTINGS_FLAGS, flags)) + goto fail; + } wpa_printf(MSG_DEBUG, "nl80211: pairwise_ciphers=0x%x", params->pairwise_ciphers); diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 83868b78e..200c545c2 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -920,8 +920,15 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) wiphy_info_tdls(capa, tb[NL80211_ATTR_TDLS_SUPPORT], tb[NL80211_ATTR_TDLS_EXTERNAL_SETUP]); - if (tb[NL80211_ATTR_DEVICE_AP_SME]) + if (tb[NL80211_ATTR_DEVICE_AP_SME]) { + u32 ap_sme_features_flags = + nla_get_u32(tb[NL80211_ATTR_DEVICE_AP_SME]); + + if (ap_sme_features_flags & NL80211_AP_SME_SA_QUERY_OFFLOAD) + capa->flags2 |= WPA_DRIVER_FLAGS2_SA_QUERY_OFFLOAD_AP; + info->device_ap_sme = 1; + } wiphy_info_feature_flags(info, tb[NL80211_ATTR_FEATURE_FLAGS]); wiphy_info_ext_feature_flags(info, tb[NL80211_ATTR_EXT_FEATURES]);