[PATCH 2/5] p2p: update dialog_token on failures as well

Eliad Peller eliad at wizery.com
Thu Mar 19 10:41:40 EDT 2015


Update the dialog token even when GO negotiation
failed, in order prevent the same dialog token
from being used again.

Signed-off-by: Eliad Peller <eliad at wizery.com>
---
 src/p2p/p2p_go_neg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index 98abf9d..f9e9581 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -807,7 +807,6 @@ void p2p_process_go_neg_req(struct p2p_data *p2p, const u8 *sa,
 			p2p_stop_find_for_freq(p2p, rx_freq);
 		p2p_set_state(p2p, P2P_GO_NEG);
 		p2p_clear_timeout(p2p);
-		dev->dialog_token = msg.dialog_token;
 		os_memcpy(dev->intended_addr, msg.intended_addr, ETH_ALEN);
 		p2p->go_neg_peer = dev;
 		eloop_cancel_timeout(p2p_go_neg_wait_timeout, p2p, NULL);
@@ -815,8 +814,10 @@ void p2p_process_go_neg_req(struct p2p_data *p2p, const u8 *sa,
 	}
 
 fail:
-	if (dev)
+	if (dev) {
 		dev->status = status;
+		dev->dialog_token = msg.dialog_token;
+	}
 	resp = p2p_build_go_neg_resp(p2p, dev, msg.dialog_token, status,
 				     !tie_breaker);
 	p2p_parse_free(&msg);
-- 
1.8.5.2.229.g4448466.dirty



More information about the HostAP mailing list