]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Do not use wait_time for SD Response TX for last fragmentation
authorJouni Malinen <j@w1.fi>
Sat, 1 Apr 2017 11:25:26 +0000 (14:25 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 1 Apr 2017 11:25:26 +0000 (14:25 +0300)
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 <j@w1.fi>
src/p2p/p2p_sd.c

index d2fb4b5b6cc1602852b9cd364b342e09ee91a549..b9e753f2051680e9e1a83359fa8310d779a752a5 100644 (file)
@@ -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);