]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Respond to GAS on the same channel it was received on
authorMichal Kazior <michal@plume.com>
Wed, 3 Mar 2021 09:53:33 +0000 (09:53 +0000)
committerJouni Malinen <j@w1.fi>
Sun, 18 Dec 2022 19:07:56 +0000 (21:07 +0200)
When I was testing dpp_auth_init on an AP with Enrollee on a different
channel from the AP I was getting failures. This happened on hwsim in
UML with time-travel for me. I don't recall seeing this with real
devices, presumably because of lax offchan implementation.

The DPP authentication would succeed. However the station would then try
to get configuration through a GAS request and fail.

The AP reported the following logs (grepped):

1614762426.860212: RX_ACTION category 4 action 10 sa 02:00:00:00:01:00 da 02:00:00:00:00:00 len 227 freq 2412
1614762426.860212: wlan0: GAS: GAS Initial Request from 02:00:00:00:01:00 (dialog token 239)
1614762426.860233: DPP: Wait for Configuration Result
1614762426.860234: nl80211: Send Action frame (ifindex=5, freq=2462 MHz wait=0 ms no_cck=0 offchanok=0)
1614762428.861186: DPP: Timeout while waiting for Configuration Result
1614762428.861186: wlan0: DPP-CONF-FAILED

While the STA reported the following logs (grepped):

1614762426.860193: wlan1: DPP-AUTH-SUCCESS init=0
1614762426.860195: DPP: Stop listen on 2412 MHz
1614762426.860202: wlan1: GAS-QUERY-START addr=02:00:00:00:00:00 dialog_token=239 freq=2412
1614762428.861185: GAS: No response received for query to 02:00:00:00:00:00 dialog token 239
1614762428.861189: DPP: GAS query did not succeed
1614762428.861189: wlan1: DPP-CONF-FAILED

AP would still receive the GAS request on ch1 but would then try to
respond on ch11 while STA was waiting on ch1.

Signed-off-by: Michal Kazior <michal@plume.com>
src/ap/dpp_hostapd.c
src/ap/gas_serv.c
src/ap/gas_serv.h

index 3c515f2688c20c7f9e027a7c85a4ff9d225e21b2..70dd18e256f806beb163b36c50c621417603061c 100644 (file)
@@ -3376,7 +3376,7 @@ static void hostapd_dpp_relay_gas_resp_tx(void *ctx, const u8 *addr,
 {
        struct hostapd_data *hapd = ctx;
 
-       gas_serv_req_dpp_processing(hapd, addr, dialog_token, prot, buf);
+       gas_serv_req_dpp_processing(hapd, addr, dialog_token, prot, buf, 0);
 }
 
 #endif /* CONFIG_DPP2 */
index 90f15778b5d125de52335ef109252730fdb4f653..4642e49273d8a69a361a6bc06017f5da9d185e15 100644 (file)
@@ -1524,7 +1524,7 @@ static void gas_serv_req_local_processing(struct hostapd_data *hapd,
 #ifdef CONFIG_DPP
 void gas_serv_req_dpp_processing(struct hostapd_data *hapd,
                                 const u8 *sa, u8 dialog_token,
-                                int prot, struct wpabuf *buf)
+                                int prot, struct wpabuf *buf, int freq)
 {
        struct wpabuf *tx_buf;
 
@@ -1582,7 +1582,7 @@ void gas_serv_req_dpp_processing(struct hostapd_data *hapd,
                return;
        if (prot)
                convert_to_protected_dual(tx_buf);
-       hostapd_drv_send_action(hapd, hapd->iface->freq, 0, sa,
+       hostapd_drv_send_action(hapd, freq ? freq : hapd->iface->freq, 0, sa,
                                wpabuf_head(tx_buf),
                                wpabuf_len(tx_buf));
        wpabuf_free(tx_buf);
@@ -1593,7 +1593,7 @@ void gas_serv_req_dpp_processing(struct hostapd_data *hapd,
 static void gas_serv_rx_gas_initial_req(struct hostapd_data *hapd,
                                        const u8 *sa,
                                        const u8 *data, size_t len, int prot,
-                                       int std_addr3)
+                                       int std_addr3, int freq)
 {
        const u8 *pos = data;
        const u8 *end = data + len;
@@ -1688,7 +1688,8 @@ static void gas_serv_rx_gas_initial_req(struct hostapd_data *hapd,
                                                  data, len);
                if (!msg)
                        return;
-               gas_serv_req_dpp_processing(hapd, sa, dialog_token, prot, msg);
+               gas_serv_req_dpp_processing(hapd, sa, dialog_token, prot, msg,
+                                           freq);
                return;
        }
 #endif /* CONFIG_DPP */
@@ -1871,7 +1872,7 @@ static void gas_serv_rx_public_action(void *ctx, const u8 *buf, size_t len,
        switch (data[0]) {
        case WLAN_PA_GAS_INITIAL_REQ:
                gas_serv_rx_gas_initial_req(hapd, sa, data + 1, len - 1, prot,
-                                           std_addr3);
+                                           std_addr3, freq);
                break;
        case WLAN_PA_GAS_COMEBACK_REQ:
                gas_serv_rx_gas_comeback_req(hapd, sa, data + 1, len - 1, prot,
index 1528af4afd91ceed320052ae9de2121f2cb6d608..7646a98a4e84d32390aa66b1cd0033edc80eeca2 100644 (file)
@@ -90,6 +90,6 @@ void gas_serv_deinit(struct hostapd_data *hapd);
 
 void gas_serv_req_dpp_processing(struct hostapd_data *hapd,
                                 const u8 *sa, u8 dialog_token,
-                                int prot, struct wpabuf *buf);
+                                int prot, struct wpabuf *buf, int freq);
 
 #endif /* GAS_SERV_H */