diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 1b7225efb..4a4bc9e63 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -1368,12 +1368,14 @@ int p2p_connect(struct p2p_data *p2p, const u8 *peer_addr, else { dev->flags &= ~P2P_DEV_PD_BEFORE_GO_NEG; /* - * Assign dialog token here to use the same value in each - * retry within the same GO Negotiation exchange. + * Assign dialog token and tie breaker here to use the same + * values in each retry within the same GO Negotiation exchange. */ dev->dialog_token++; if (dev->dialog_token == 0) dev->dialog_token = 1; + dev->tie_breaker = p2p->next_tie_breaker; + p2p->next_tie_breaker = !p2p->next_tie_breaker; } dev->connect_reqs = 0; dev->go_neg_req_sent = 0; diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c index 38d42755b..8811c8557 100644 --- a/src/p2p/p2p_go_neg.c +++ b/src/p2p/p2p_go_neg.c @@ -161,9 +161,7 @@ static struct wpabuf * p2p_build_go_neg_req(struct p2p_data *p2p, p2p_buf_add_capability(buf, p2p->dev_capab & ~P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY, group_capab); - p2p_buf_add_go_intent(buf, (p2p->go_intent << 1) | - p2p->next_tie_breaker); - p2p->next_tie_breaker = !p2p->next_tie_breaker; + p2p_buf_add_go_intent(buf, (p2p->go_intent << 1) | peer->tie_breaker); p2p_buf_add_config_timeout(buf, p2p->go_timeout, p2p->client_timeout); p2p_buf_add_listen_channel(buf, p2p->cfg->country, p2p->cfg->reg_class, p2p->cfg->channel); diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h index 005f73b08..e91959f82 100644 --- a/src/p2p/p2p_i.h +++ b/src/p2p/p2p_i.h @@ -52,6 +52,7 @@ struct p2p_device { int go_neg_req_sent; enum p2p_go_state go_state; u8 dialog_token; + u8 tie_breaker; u8 intended_addr[ETH_ALEN]; char country[3];