[PATCH] gas_query: use announced comeback_delay for Comeback Response

Gustavo Bertoli gubertoli at gmail.com
Tue May 5 11:05:30 PDT 2026


Currently, the GAS client manages the Comeback Response wait timer
(gas_query_rx_comeback_timeout) using value based on GAS_QUERY_WAIT_TIME_COMEBACK.
This timer fails to take the server-announced comeback_delay into
consideration.

During DPP Enterprise provisioning, a DPP Configurator may announce
longer comeback_delay (dpp_supplicant.c, comeback_delay = 1000).
Because the client only waits 160 ms for the response,
it prematurely times out and restarts the GAS dialog with a new
dialog token.

This change fix protocol-level asymmetry by making the client respect the
server's provided delay. The Comeback Response wait timer is now derived
from the server's announced comeback_delay (plus a 10 ms margin for
processing delay).

Signed-off-by: Gustavo Bertoli <gubertoli at gmail.com>
---
 wpa_supplicant/gas_query.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/gas_query.c b/wpa_supplicant/gas_query.c
index 73cc34e0a..1198eafd2 100644
--- a/wpa_supplicant/gas_query.c
+++ b/wpa_supplicant/gas_query.c
@@ -42,6 +42,7 @@ struct gas_query_pending {
 	u8 addr[ETH_ALEN];
 	u8 dialog_token;
 	u8 next_frag_id;
+	u16 comeback_delay;
 	unsigned int wait_comeback:1;
 	unsigned int offchannel_tx_started:1;
 	unsigned int retry:1;
@@ -279,10 +280,20 @@ static void gas_query_tx_status(struct wpa_supplicant *wpa_s,
 					       gas_query_timeout, gas, query);
 		}
 		if (query->wait_comeback && !query->retry) {
+			unsigned int wait_us;
+			u32 cd_us;
+			
 			eloop_cancel_timeout(gas_query_rx_comeback_timeout,
 					     gas, query);
+
+			cd_us = query->comeback_delay
+				? (u32) query->comeback_delay * 1024
+				: GAS_QUERY_WAIT_TIME_COMEBACK * 1000;
+			
+			wait_us = cd_us + 10 * 1000; /* Add 10ms margin */
+
 			eloop_register_timeout(
-				0, (GAS_QUERY_WAIT_TIME_COMEBACK + 10) * 1000,
+				0, wait_us,
 				gas_query_rx_comeback_timeout, gas, query);
 		}
 	}
@@ -412,6 +423,7 @@ static void gas_query_tx_comeback_req_delay(struct gas_query *gas,
 		query->offchannel_tx_started = 0;
 	}
 
+	query->comeback_delay = comeback_delay;
 	secs = (comeback_delay * 1024) / 1000000;
 	usecs = comeback_delay * 1024 - secs * 1000000;
 	wpa_printf(MSG_DEBUG, "GAS: Send comeback request to " MACSTR
-- 
2.43.0




More information about the Hostap mailing list