[PATCH v2 1/5] gas_server: resend a response fragment after a lost ACK
Gustavo Bertoli
gubertoli at gmail.com
Wed Aug 5 10:53:48 PDT 2026
A fragmented GAS response advances its cursor as each fragment is handed
to the driver, regardless of whether that fragment was ACKed. On a
remain-on-channel rendezvous a fragment can be lost to dwell
misalignment after the cursor has moved past it, and the no-ACK TX
status then drops the whole pending entry, ending the exchange. Track
the previous offset and on a no-ACK TX status roll back and resend that
fragment on the next Comeback Request.
If it was the ACK frame that was lost rather than the fragment, the peer
receives the same fragment again in a new MMPDU. The Fragment ID field
makes that retransmission detectable and gas_query_rx_comeback() already
drops such a frame as a possible retry of the previous fragment; the
current code fails in both loss cases by dropping the pending entry.
Signed-off-by: Gustavo Bertoli <gubertoli at gmail.com>
---
src/common/gas_server.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/common/gas_server.c b/src/common/gas_server.c
index 52c14df36..012bf2939 100644
--- a/src/common/gas_server.c
+++ b/src/common/gas_server.c
@@ -36,6 +36,7 @@ struct gas_server_handler {
struct gas_server_response {
struct dl_list list;
size_t offset;
+ size_t last_offset;
u8 frag_id;
struct wpabuf *resp;
int freq;
@@ -332,6 +333,7 @@ gas_server_handle_rx_comeback_req(struct gas_server_response *response)
wpabuf_put_data(resp, wpabuf_head_u8(response->resp) + response->offset,
resp_frag_len);
+ response->last_offset = response->offset;
response->offset += resp_frag_len;
if (remaining > resp_frag_len)
@@ -430,6 +432,15 @@ static void gas_server_handle_tx_status(struct gas_server_response *response,
return;
}
+ if (!ack && response->resp) {
+ /* Fragment not ACKed; roll back to resend on the next request */
+ if (response->frag_id > 0) {
+ response->offset = response->last_offset;
+ response->frag_id--;
+ }
+ return;
+ }
+
if (!ack)
wpa_printf(MSG_DEBUG,
"GAS: No ACK received - drop pending entry");
--
2.39.5
More information about the Hostap
mailing list