aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-11-05 16:17:20 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-05 16:17:20 (GMT)
commitf44ae2078380a9548eae859a4454e756a0bfea8f (patch)
tree4f96b936b3f4d3e9e0dc5b4669f86fa1fe3d0e91
parent7e3c178142f68daaea081e2b9e0bd78a6bcd0d47 (diff)
downloadhostap-f44ae2078380a9548eae859a4454e756a0bfea8f.zip
hostap-f44ae2078380a9548eae859a4454e756a0bfea8f.tar.gz
hostap-f44ae2078380a9548eae859a4454e756a0bfea8f.tar.bz2
P2P: Drop pending TX frame on new p2p_connect
We need to drop the pending frame to avoid issues with the new GO Negotiation, e.g., when the pending frame was from a previous attempt at starting a GO Negotiation.
-rw-r--r--src/p2p/p2p.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index d060de8..1f0d7c1 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -932,6 +932,19 @@ int p2p_connect(struct p2p_data *p2p, const u8 *peer_addr,
if (p2p->state != P2P_IDLE)
p2p_stop_find(p2p);
+ if (p2p->after_scan_tx) {
+ /*
+ * We need to drop the pending frame to avoid issues with the
+ * new GO Negotiation, e.g., when the pending frame was from a
+ * previous attempt at starting a GO Negotiation.
+ */
+ wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Dropped "
+ "previous pending Action frame TX that was waiting "
+ "for p2p_scan completion");
+ os_free(p2p->after_scan_tx);
+ p2p->after_scan_tx = NULL;
+ }
+
dev->wps_method = wps_method;
dev->status = P2P_SC_SUCCESS;
@@ -1869,6 +1882,8 @@ void p2p_flush(struct p2p_data *p2p)
p2p_device_free(p2p, dev);
}
p2p_free_sd_queries(p2p);
+ os_free(p2p->after_scan_tx);
+ p2p->after_scan_tx = NULL;
}