diff options
Diffstat (limited to 'src/ap')
-rw-r--r-- | src/ap/gas_serv.c | 16 | ||||
-rw-r--r-- | src/ap/ieee802_11.c | 28 |
2 files changed, 32 insertions, 12 deletions
diff --git a/src/ap/gas_serv.c b/src/ap/gas_serv.c index 53e6cbb..851c183 100644 --- a/src/ap/gas_serv.c +++ b/src/ap/gas_serv.c @@ -128,6 +128,7 @@ static void gas_serv_free_dialogs(struct hostapd_data *hapd, } +#ifdef CONFIG_HS20 static void anqp_add_hs_capab_list(struct hostapd_data *hapd, struct wpabuf *buf) { @@ -151,6 +152,7 @@ static void anqp_add_hs_capab_list(struct hostapd_data *hapd, wpabuf_put_u8(buf, HS20_STYPE_OPERATING_CLASS); gas_anqp_set_element_len(buf, len); } +#endif /* CONFIG_HS20 */ static void anqp_add_capab_list(struct hostapd_data *hapd, @@ -174,7 +176,9 @@ static void anqp_add_capab_list(struct hostapd_data *hapd, wpabuf_put_le16(buf, ANQP_3GPP_CELLULAR_NETWORK); if (hapd->conf->domain_name) wpabuf_put_le16(buf, ANQP_DOMAIN_NAME); +#ifdef CONFIG_HS20 anqp_add_hs_capab_list(hapd, buf); +#endif /* CONFIG_HS20 */ gas_anqp_set_element_len(buf, len); } @@ -429,6 +433,8 @@ static void anqp_add_domain_name(struct hostapd_data *hapd, struct wpabuf *buf) } +#ifdef CONFIG_HS20 + static void anqp_add_operator_friendly_name(struct hostapd_data *hapd, struct wpabuf *buf) { @@ -499,6 +505,8 @@ static void anqp_add_operating_class(struct hostapd_data *hapd, } } +#endif /* CONFIG_HS20 */ + static struct wpabuf * gas_serv_build_gas_resp_payload(struct hostapd_data *hapd, @@ -531,6 +539,7 @@ gas_serv_build_gas_resp_payload(struct hostapd_data *hapd, if (request & ANQP_REQ_DOMAIN_NAME) anqp_add_domain_name(hapd, buf); +#ifdef CONFIG_HS20 if (request & ANQP_REQ_HS_CAPABILITY_LIST) anqp_add_hs_capab_list(hapd, buf); if (request & ANQP_REQ_OPERATOR_FRIENDLY_NAME) @@ -541,6 +550,7 @@ gas_serv_build_gas_resp_payload(struct hostapd_data *hapd, anqp_add_connection_capability(hapd, buf); if (request & ANQP_REQ_OPERATING_CLASS) anqp_add_operating_class(hapd, buf); +#endif /* CONFIG_HS20 */ return buf; } @@ -649,6 +659,8 @@ static void rx_anqp_query_list(struct hostapd_data *hapd, } +#ifdef CONFIG_HS20 + static void rx_anqp_hs_query_list(struct hostapd_data *hapd, u8 subtype, struct anqp_query_info *qi) { @@ -755,6 +767,8 @@ static void rx_anqp_vendor_specific(struct hostapd_data *hapd, } } +#endif /* CONFIG_HS20 */ + static void gas_serv_req_local_processing(struct hostapd_data *hapd, const u8 *sa, u8 dialog_token, @@ -899,9 +913,11 @@ static void gas_serv_rx_gas_initial_req(struct hostapd_data *hapd, case ANQP_QUERY_LIST: rx_anqp_query_list(hapd, pos, pos + elen, &qi); break; +#ifdef CONFIG_HS20 case ANQP_VENDOR_SPECIFIC: rx_anqp_vendor_specific(hapd, pos, pos + elen, &qi); break; +#endif /* CONFIG_HS20 */ default: wpa_printf(MSG_DEBUG, "ANQP: Unsupported Query " "Request element %u", info_id); diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 211ee1b..ce20e5f 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -1506,13 +1506,6 @@ static void handle_assoc_cb(struct hostapd_data *hapd, int new_assoc = 1; struct ieee80211_ht_capabilities ht_cap; - if (!ok) { - hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211, - HOSTAPD_LEVEL_DEBUG, - "did not acknowledge association response"); - return; - } - if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) : sizeof(mgmt->u.assoc_resp))) { printf("handle_assoc_cb(reassoc=%d) - too short payload " @@ -1520,11 +1513,6 @@ static void handle_assoc_cb(struct hostapd_data *hapd, return; } - if (reassoc) - status = le_to_host16(mgmt->u.reassoc_resp.status_code); - else - status = le_to_host16(mgmt->u.assoc_resp.status_code); - sta = ap_get_sta(hapd, mgmt->da); if (!sta) { printf("handle_assoc_cb: STA " MACSTR " not found\n", @@ -1532,6 +1520,19 @@ static void handle_assoc_cb(struct hostapd_data *hapd, return; } + if (!ok) { + hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_DEBUG, + "did not acknowledge association response"); + sta->flags &= ~WLAN_STA_ASSOC_REQ_OK; + return; + } + + if (reassoc) + status = le_to_host16(mgmt->u.reassoc_resp.status_code); + else + status = le_to_host16(mgmt->u.assoc_resp.status_code); + if (status != WLAN_STATUS_SUCCESS) goto fail; @@ -1830,6 +1831,9 @@ void ieee802_11_rx_from_unknown(struct hostapd_data *hapd, const u8 *src, sta = ap_get_sta(hapd, src); if (sta && (sta->flags & WLAN_STA_ASSOC)) { + if (!hapd->conf->wds_sta) + return; + if (wds && !(sta->flags & WLAN_STA_WDS)) { wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for " "STA " MACSTR " (aid %u)", |