From 2971da270f9be3c3bd4d8e93393a6454c7daf959 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 1 Apr 2017 14:25:26 +0300 Subject: [PATCH] P2P: Do not use wait_time for SD Response TX for last fragmentation The last SD Response frame fragment is not going to be followed by another Action frame from the peer, so remove the 200 ms wait time from the offchannel TX command in that case. This avoids leaving a 200 ms lock on the radio to remain on the channel unnecessarily. This is similar to commit 7655bd7388f82e67a2d0461ccab0ae037bb8cd77 ('P2P: Do not use wait_time for SD Response TX without fragmentation'). Signed-off-by: Jouni Malinen --- src/p2p/p2p_sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p2p/p2p_sd.c b/src/p2p/p2p_sd.c index d2fb4b5b6..b9e753f20 100644 --- a/src/p2p/p2p_sd.c +++ b/src/p2p/p2p_sd.c @@ -625,6 +625,7 @@ void p2p_rx_gas_comeback_req(struct p2p_data *p2p, const u8 *sa, u8 dialog_token; size_t frag_len, max_len; int more = 0; + unsigned int wait_time = 200; wpa_hexdump(MSG_DEBUG, "P2P: RX GAS Comeback Request", data, len); if (len < 1) @@ -677,12 +678,13 @@ void p2p_rx_gas_comeback_req(struct p2p_data *p2p, const u8 *sa, p2p_dbg(p2p, "All fragments of SD response sent"); wpabuf_free(p2p->sd_resp); p2p->sd_resp = NULL; + wait_time = 0; /* no more SD frames in the sequence */ } p2p->pending_action_state = P2P_NO_PENDING_ACTION; if (p2p_send_action(p2p, rx_freq, sa, p2p->cfg->dev_addr, p2p->cfg->dev_addr, - wpabuf_head(resp), wpabuf_len(resp), 200) < 0) + wpabuf_head(resp), wpabuf_len(resp), wait_time) < 0) p2p_dbg(p2p, "Failed to send Action frame"); wpabuf_free(resp);