hostapd Make GAS Address3 field selection behavior configurable
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 10 Jun 2016 18:43:25 +0000 (21:43 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 10 Jun 2016 19:13:37 +0000 (22:13 +0300)
gas_address3=1 can now be used to force hostapd to use the IEEE 802.11
standards compliant Address 3 field value (Wildcard BSSID when not
associated) even if the GAS request uses non-compliant address (AP
BSSID).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.h
src/ap/gas_serv.c

index dbeaa3c..6dc7e8c 100644 (file)
@@ -3481,6 +3481,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                if (atoi(pos))
                        bss->radio_measurements[0] |=
                                WLAN_RRM_CAPS_NEIGHBOR_REPORT;
+       } else if (os_strcmp(buf, "gas_address3") == 0) {
+               bss->gas_address3 = atoi(pos);
        } else {
                wpa_printf(MSG_ERROR,
                           "Line %d: unknown configuration item '%s'",
index c62fc7e..c19291d 100644 (file)
@@ -1747,6 +1747,13 @@ own_ip_addr=127.0.0.1
 # For example, AP Civic Location ANQP-element with unknown location:
 #anqp_elem=266:000000
 
+# GAS Address 3 behavior
+# 0 = P2P specification (Address3 = AP BSSID) workaround enabled by default
+#     based on GAS request Address3
+# 1 = IEEE 802.11 standard compliant regardless of GAS request Address3
+# 2 = Force non-compliant behavior (Address3 = AP BSSID for all cases)
+#gas_address3=0
+
 # QoS Map Set configuration
 #
 # Comma delimited QoS Map Set in decimal values
index b263eb0..fbe97fc 100644 (file)
@@ -504,6 +504,7 @@ struct hostapd_bss_config {
 
        u16 gas_comeback_delay;
        int gas_frag_limit;
+       int gas_address3;
 
        u8 qos_map_set[16 + 2 * 21];
        unsigned int qos_map_set_len;
index 2b6efa8..6ce178d 100644 (file)
@@ -1470,7 +1470,12 @@ static void gas_serv_rx_public_action(void *ctx, const u8 *buf, size_t len,
         */
        prot = mgmt->u.action.category == WLAN_ACTION_PROTECTED_DUAL;
        sa = mgmt->sa;
-       std_addr3 = is_broadcast_ether_addr(mgmt->bssid);
+       if (hapd->conf->gas_address3 == 1)
+               std_addr3 = 1;
+       else if (hapd->conf->gas_address3 == 2)
+               std_addr3 = 0;
+       else
+               std_addr3 = is_broadcast_ether_addr(mgmt->bssid);
        len -= IEEE80211_HDRLEN + 1;
        data = buf + IEEE80211_HDRLEN + 1;
        switch (data[0]) {