Revert "Revert "[wpa_supplicant] cumilative patch from commit 3a..."
Revert submission 28102966-revert-26533062-Supplicant_merge_June24-CUATTSRBBR
Reason for revert: Fixed the regression issue (ag/28389573)
Reverted changes: /q/submissionid:28102966-revert-26533062-Supplicant_merge_June24-CUATTSRBBR
Bug: 329004037
Test: Turn ON/OFF SoftAp multiple times
Change-Id: Ibfff2a847be5678f1a6d77e28506a05936812a91
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 267399d..0f9c924 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -301,6 +301,8 @@
ies) < 0) {
p2p_dbg(p2p, "Failed to start listen mode");
p2p->pending_listen_freq = 0;
+ } else {
+ p2p->pending_listen_wait_drv = true;
}
wpabuf_free(ies);
}
@@ -350,6 +352,7 @@
wpabuf_free(ies);
return -1;
}
+ p2p->pending_listen_wait_drv = true;
wpabuf_free(ies);
p2p_set_state(p2p, P2P_LISTEN_ONLY);
@@ -378,7 +381,7 @@
{
struct p2p_device *dev;
dl_list_for_each(dev, &p2p->devices, struct p2p_device, list) {
- if (os_memcmp(dev->info.p2p_device_addr, addr, ETH_ALEN) == 0)
+ if (ether_addr_equal(dev->info.p2p_device_addr, addr))
return dev;
}
return NULL;
@@ -396,7 +399,7 @@
{
struct p2p_device *dev;
dl_list_for_each(dev, &p2p->devices, struct p2p_device, list) {
- if (os_memcmp(dev->interface_addr, addr, ETH_ALEN) == 0)
+ if (ether_addr_equal(dev->interface_addr, addr))
return dev;
}
return NULL;
@@ -486,8 +489,8 @@
* group, the information will be restored in the loop following this.
*/
dl_list_for_each(dev, &p2p->devices, struct p2p_device, list) {
- if (os_memcmp(dev->member_in_go_iface, go_interface_addr,
- ETH_ALEN) == 0) {
+ if (ether_addr_equal(dev->member_in_go_iface,
+ go_interface_addr)) {
os_memset(dev->member_in_go_iface, 0, ETH_ALEN);
os_memset(dev->member_in_go_dev, 0, ETH_ALEN);
}
@@ -495,8 +498,7 @@
for (c = 0; c < info.num_clients; c++) {
struct p2p_client_info *cli = &info.client[c];
- if (os_memcmp(cli->p2p_device_addr, p2p->cfg->dev_addr,
- ETH_ALEN) == 0)
+ if (ether_addr_equal(cli->p2p_device_addr, p2p->cfg->dev_addr))
continue; /* ignore our own entry */
dev = p2p_get_device(p2p, cli->p2p_device_addr);
if (dev) {
@@ -754,7 +756,7 @@
}
if (!is_zero_ether_addr(p2p->peer_filter) &&
- os_memcmp(p2p_dev_addr, p2p->peer_filter, ETH_ALEN) != 0) {
+ !ether_addr_equal(p2p_dev_addr, p2p->peer_filter)) {
p2p_dbg(p2p, "Do not add peer filter for " MACSTR
" due to peer filter", MAC2STR(p2p_dev_addr));
p2p_parse_free(&msg);
@@ -799,7 +801,7 @@
dev->flags &= ~(P2P_DEV_PROBE_REQ_ONLY | P2P_DEV_GROUP_CLIENT_ONLY |
P2P_DEV_LAST_SEEN_AS_GROUP_CLIENT);
- if (os_memcmp(addr, p2p_dev_addr, ETH_ALEN) != 0)
+ if (!ether_addr_equal(addr, p2p_dev_addr))
os_memcpy(dev->interface_addr, addr, ETH_ALEN);
if (msg.ssid &&
msg.ssid[1] <= sizeof(dev->oper_ssid) &&
@@ -1030,6 +1032,7 @@
return;
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
if (p2p->find_pending_full &&
(p2p->find_type == P2P_FIND_PROGRESSIVE ||
@@ -1247,6 +1250,7 @@
p2p->pending_listen_freq = 0;
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
p2p->find_pending_full = 0;
p2p->find_type = type;
if (freq != 2412 && freq != 2437 && freq != 2462 && freq != 60480)
@@ -1341,6 +1345,10 @@
void p2p_stop_listen_for_freq(struct p2p_data *p2p, int freq)
{
+ p2p_dbg(p2p,
+ "%s(freq=%d) pending_listen_freq=%d in_listen=%d drv_in_listen=%d",
+ __func__, freq, p2p->pending_listen_freq, p2p->in_listen,
+ p2p->drv_in_listen);
if (freq > 0 &&
((p2p->drv_in_listen == freq && p2p->in_listen) ||
p2p->pending_listen_freq == (unsigned int) freq)) {
@@ -1360,7 +1368,15 @@
p2p_dbg(p2p, "Clear drv_in_listen (%d)", p2p->drv_in_listen);
p2p->drv_in_listen = 0;
}
+ if (p2p->pending_listen_freq &&
+ p2p->pending_listen_freq != (unsigned int) freq &&
+ !p2p->drv_in_listen && p2p->pending_listen_wait_drv) {
+ p2p_dbg(p2p,
+ "Clear pending_listen_freq since the started listen did not complete before being stopped");
+ p2p->pending_listen_freq = 0;
+ }
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
}
@@ -2029,6 +2045,7 @@
p2p->pending_listen_freq = 0;
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
p2p->go_neg_peer->status = P2P_SC_SUCCESS;
/*
* Set new timeout to make sure a previously set one does not expire
@@ -2049,6 +2066,7 @@
p2p->pending_listen_freq = 0;
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
p2p_invite_send(p2p, p2p->invite_peer, p2p->invite_go_dev_addr,
p2p->invite_dev_pw_id);
}
@@ -2383,7 +2401,7 @@
}
if (dst && !is_broadcast_ether_addr(dst) &&
- os_memcmp(dst, p2p->cfg->dev_addr, ETH_ALEN) != 0) {
+ !ether_addr_equal(dst, p2p->cfg->dev_addr)) {
/* Not sent to the broadcast address or our P2P Device Address
*/
p2p_dbg(p2p, "Probe Req DA " MACSTR " not ours - ignore it",
@@ -2467,7 +2485,7 @@
}
if (msg.device_id &&
- os_memcmp(msg.device_id, p2p->cfg->dev_addr, ETH_ALEN) != 0) {
+ !ether_addr_equal(msg.device_id, p2p->cfg->dev_addr)) {
/* Device ID did not match */
p2p_dbg(p2p, "Probe Req requested Device ID " MACSTR " did not match - ignore it",
MAC2STR(msg.device_id));
@@ -2556,8 +2574,7 @@
*/
if ((p2p->state == P2P_CONNECT || p2p->state == P2P_CONNECT_LISTEN) &&
p2p->go_neg_peer &&
- os_memcmp(addr, p2p->go_neg_peer->info.p2p_device_addr, ETH_ALEN)
- == 0 &&
+ ether_addr_equal(addr, p2p->go_neg_peer->info.p2p_device_addr) &&
!(p2p->go_neg_peer->flags & P2P_DEV_WAIT_GO_NEG_CONFIRM)) {
/* Received a Probe Request from GO Negotiation peer */
p2p_dbg(p2p, "Found GO Negotiation peer - try to start GO negotiation from timeout");
@@ -2569,8 +2586,7 @@
if ((p2p->state == P2P_INVITE || p2p->state == P2P_INVITE_LISTEN) &&
p2p->invite_peer &&
(p2p->invite_peer->flags & P2P_DEV_WAIT_INV_REQ_ACK) &&
- os_memcmp(addr, p2p->invite_peer->info.p2p_device_addr, ETH_ALEN)
- == 0) {
+ ether_addr_equal(addr, p2p->invite_peer->info.p2p_device_addr)) {
/* Received a Probe Request from Invite peer */
p2p_dbg(p2p, "Found Invite peer - try to start Invite from timeout");
eloop_cancel_timeout(p2p_invite_start, p2p, NULL);
@@ -2923,8 +2939,7 @@
return; /* No pending Group Formation */
}
- if (os_memcmp(mac_addr, p2p->go_neg_peer->intended_addr, ETH_ALEN) !=
- 0) {
+ if (!ether_addr_equal(mac_addr, p2p->go_neg_peer->intended_addr)) {
p2p_dbg(p2p, "Ignore WPS registration success notification for "
MACSTR " (GO Negotiation peer " MACSTR ")",
MAC2STR(mac_addr),
@@ -3397,8 +3412,8 @@
*/
dl_list_for_each(dev, &p2p->devices, struct p2p_device, list) {
- if (os_memcmp(p2p->pending_pd_devaddr,
- dev->info.p2p_device_addr, ETH_ALEN) != 0)
+ if (!ether_addr_equal(p2p->pending_pd_devaddr,
+ dev->info.p2p_device_addr))
continue;
if (!dev->req_config_methods)
continue;
@@ -3881,6 +3896,7 @@
p2p_dbg(p2p, "Starting Listen timeout(%u,%u) on freq=%u based on callback",
p2p->pending_listen_sec, p2p->pending_listen_usec,
p2p->pending_listen_freq);
+ p2p->pending_listen_wait_drv = false;
p2p->in_listen = 1;
p2p->drv_in_listen = freq;
if (p2p->pending_listen_sec || p2p->pending_listen_usec) {
@@ -4036,6 +4052,7 @@
p2p_dbg(p2p, "Go to Listen state while waiting for the peer to become ready for GO Negotiation");
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
if (p2p->pending_listen_freq) {
p2p_dbg(p2p, "Clear pending_listen_freq for %s", __func__);
p2p->pending_listen_freq = 0;
@@ -4089,8 +4106,8 @@
int for_join = 0;
dl_list_for_each(dev, &p2p->devices, struct p2p_device, list) {
- if (os_memcmp(p2p->pending_pd_devaddr,
- dev->info.p2p_device_addr, ETH_ALEN) != 0)
+ if (!ether_addr_equal(p2p->pending_pd_devaddr,
+ dev->info.p2p_device_addr))
continue;
if (dev->req_config_methods &&
(dev->flags & P2P_DEV_PD_FOR_JOIN))
@@ -4163,6 +4180,7 @@
if (p2p->drv_in_listen) {
p2p_dbg(p2p, "Driver is still in listen state - stop it");
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
}
switch (p2p->state) {
@@ -4557,8 +4575,8 @@
p2p_dbg(p2p, "Received P2P Action - P2P Presence Request");
for (g = 0; g < p2p->num_groups; g++) {
- if (os_memcmp(da, p2p_group_get_interface_addr(p2p->groups[g]),
- ETH_ALEN) == 0) {
+ if (ether_addr_equal(
+ da, p2p_group_get_interface_addr(p2p->groups[g]))) {
group = p2p->groups[g];
break;
}
@@ -4656,15 +4674,6 @@
p2p_ext_listen_timeout, p2p, NULL);
}
- if ((p2p->cfg->is_p2p_in_progress &&
- p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) ||
- (p2p->pending_action_state == P2P_PENDING_PD &&
- p2p->pd_retries > 0)) {
- p2p_dbg(p2p, "Operation in progress - skip Extended Listen timeout (%s)",
- p2p_state_txt(p2p->state));
- return;
- }
-
if (p2p->state == P2P_LISTEN_ONLY && p2p->ext_listen_only) {
/*
* This should not really happen, but it looks like the Listen
@@ -4677,6 +4686,15 @@
p2p_set_state(p2p, P2P_IDLE);
}
+ if ((p2p->cfg->is_p2p_in_progress &&
+ p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) ||
+ (p2p->pending_action_state == P2P_PENDING_PD &&
+ p2p->pd_retries > 0)) {
+ p2p_dbg(p2p, "Operation in progress - skip Extended Listen timeout (%s)",
+ p2p_state_txt(p2p->state));
+ return;
+ }
+
if (p2p->state != P2P_IDLE) {
p2p_dbg(p2p, "Skip Extended Listen timeout in active state (%s)", p2p_state_txt(p2p->state));
return;
diff --git a/src/p2p/p2p_dev_disc.c b/src/p2p/p2p_dev_disc.c
index 98805fe..ff2bdfc 100644
--- a/src/p2p/p2p_dev_disc.c
+++ b/src/p2p/p2p_dev_disc.c
@@ -223,7 +223,7 @@
go = p2p->pending_client_disc_go;
if (go == NULL ||
- os_memcmp(sa, go->info.p2p_device_addr, ETH_ALEN) != 0) {
+ !ether_addr_equal(sa, go->info.p2p_device_addr)) {
p2p_dbg(p2p, "Ignore unexpected Device Discoverability Response");
return;
}
@@ -249,10 +249,10 @@
p2p_dbg(p2p, "Device Discoverability Response status %u", status);
if (p2p->go_neg_peer == NULL ||
- os_memcmp(p2p->pending_client_disc_addr,
- p2p->go_neg_peer->info.p2p_device_addr, ETH_ALEN) != 0 ||
- os_memcmp(p2p->go_neg_peer->member_in_go_dev,
- go->info.p2p_device_addr, ETH_ALEN) != 0) {
+ !ether_addr_equal(p2p->pending_client_disc_addr,
+ p2p->go_neg_peer->info.p2p_device_addr) ||
+ !ether_addr_equal(p2p->go_neg_peer->member_in_go_dev,
+ go->info.p2p_device_addr)) {
p2p_dbg(p2p, "No pending operation with the client discoverability peer anymore");
return;
}
diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index 55db8a5..30901b3 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -859,7 +859,7 @@
goto fail;
}
- if (os_memcmp(msg.p2p_device_addr, sa, ETH_ALEN) != 0) {
+ if (!ether_addr_equal(msg.p2p_device_addr, sa)) {
p2p_dbg(p2p, "Unexpected GO Negotiation Request SA=" MACSTR
" != dev_addr=" MACSTR,
MAC2STR(sa), MAC2STR(msg.p2p_device_addr));
diff --git a/src/p2p/p2p_group.c b/src/p2p/p2p_group.c
index aa18af6..c036f92 100644
--- a/src/p2p/p2p_group.c
+++ b/src/p2p/p2p_group.c
@@ -579,7 +579,7 @@
m = group->members;
prev = NULL;
while (m) {
- if (os_memcmp(m->addr, addr, ETH_ALEN) == 0)
+ if (ether_addr_equal(m->addr, addr))
break;
prev = m;
m = m->next;
@@ -785,11 +785,11 @@
if (!msg.device_id)
return 1; /* No filter on Device ID */
- if (os_memcmp(msg.device_id, group->p2p->cfg->dev_addr, ETH_ALEN) == 0)
+ if (ether_addr_equal(msg.device_id, group->p2p->cfg->dev_addr))
return 1; /* Match with our P2P Device Address */
for (m = group->members; m; m = m->next) {
- if (os_memcmp(msg.device_id, m->dev_addr, ETH_ALEN) == 0)
+ if (ether_addr_equal(msg.device_id, m->dev_addr))
return 1; /* Match with group client P2P Device Address */
}
@@ -844,7 +844,7 @@
struct p2p_group_member *m;
for (m = group->members; m; m = m->next) {
- if (os_memcmp(dev_id, m->dev_addr, ETH_ALEN) == 0)
+ if (ether_addr_equal(dev_id, m->dev_addr))
return m;
}
@@ -872,7 +872,7 @@
struct p2p_group_member *m;
for (m = group->members; m; m = m->next) {
- if (os_memcmp(interface_addr, m->addr, ETH_ALEN) == 0)
+ if (ether_addr_equal(interface_addr, m->addr))
return m;
}
@@ -1038,7 +1038,7 @@
struct p2p_group_member *m;
for (m = group->members; m; m = m->next) {
- if (os_memcmp(m->dev_addr, dev_addr, ETH_ALEN) == 0)
+ if (ether_addr_equal(m->dev_addr, dev_addr))
return 1;
}
@@ -1051,7 +1051,7 @@
{
if (group_id_len != ETH_ALEN + group->cfg->ssid_len)
return 0;
- if (os_memcmp(group_id, group->p2p->cfg->dev_addr, ETH_ALEN) != 0)
+ if (!ether_addr_equal(group_id, group->p2p->cfg->dev_addr))
return 0;
return os_memcmp(group_id + ETH_ALEN, group->cfg->ssid,
group->cfg->ssid_len) == 0;
diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h
index 235467e..f24544c 100644
--- a/src/p2p/p2p_i.h
+++ b/src/p2p/p2p_i.h
@@ -400,6 +400,7 @@
unsigned int pending_listen_freq;
unsigned int pending_listen_sec;
unsigned int pending_listen_usec;
+ bool pending_listen_wait_drv;
u8 dev_capab;
diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c
index 941ec00..70a7f6f 100644
--- a/src/p2p/p2p_invitation.c
+++ b/src/p2p/p2p_invitation.c
@@ -33,8 +33,8 @@
for (i = 0; i < p2p->num_groups; i++) {
struct p2p_group *g = p2p->groups[i];
struct wpabuf *ie;
- if (os_memcmp(p2p_group_get_interface_addr(g),
- p2p->inv_bssid, ETH_ALEN) != 0)
+ if (!ether_addr_equal(p2p_group_get_interface_addr(g),
+ p2p->inv_bssid))
continue;
ie = p2p_group_get_wfd_ie(g);
if (ie) {
@@ -127,8 +127,8 @@
for (i = 0; i < p2p->num_groups; i++) {
struct p2p_group *g = p2p->groups[i];
struct wpabuf *ie;
- if (os_memcmp(p2p_group_get_interface_addr(g),
- group_bssid, ETH_ALEN) != 0)
+ if (!ether_addr_equal(p2p_group_get_interface_addr(g),
+ group_bssid))
continue;
ie = p2p_group_get_wfd_ie(g);
if (ie) {
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index f75cee8..542521e 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -544,7 +544,7 @@
if (msg->persistent_dev) {
channel_list = 1;
config_timeout = 1;
- if (os_memcmp(msg->persistent_dev, addr, ETH_ALEN) == 0) {
+ if (ether_addr_equal(msg->persistent_dev, addr)) {
intended_addr = 1;
operating_channel = 1;
}
@@ -730,7 +730,7 @@
if (!msg.status) {
unsigned int forced_freq, pref_freq;
- if (os_memcmp(p2p->cfg->dev_addr, msg.adv_mac, ETH_ALEN)) {
+ if (!ether_addr_equal(p2p->cfg->dev_addr, msg.adv_mac)) {
p2p_dbg(p2p,
"P2PS PD adv mac does not match the local one");
reject = P2P_SC_FAIL_INCOMPATIBLE_PARAMS;
@@ -892,14 +892,14 @@
goto out;
if (p2p->p2ps_prov->adv_id != adv_id ||
- os_memcmp(p2p->p2ps_prov->adv_mac, msg.adv_mac, ETH_ALEN)) {
+ !ether_addr_equal(p2p->p2ps_prov->adv_mac, msg.adv_mac)) {
p2p_dbg(p2p,
"P2PS Follow-on PD with mismatch Advertisement ID/MAC");
goto out;
}
if (p2p->p2ps_prov->session_id != session_id ||
- os_memcmp(p2p->p2ps_prov->session_mac, msg.session_mac, ETH_ALEN)) {
+ !ether_addr_equal(p2p->p2ps_prov->session_mac, msg.session_mac)) {
p2p_dbg(p2p, "P2PS Follow-on PD with mismatch Session ID/MAC");
goto out;
}
@@ -1239,8 +1239,7 @@
return -1;
}
- if (os_memcmp(p2p->p2ps_prov->session_mac, msg->session_mac,
- ETH_ALEN)) {
+ if (!ether_addr_equal(p2p->p2ps_prov->session_mac, msg->session_mac)) {
p2p_dbg(p2p,
"Ignore PD Response with unexpected Session MAC");
return -1;
@@ -1252,7 +1251,7 @@
return -1;
}
- if (os_memcmp(p2p->p2ps_prov->adv_mac, msg->adv_mac, ETH_ALEN) != 0) {
+ if (!ether_addr_equal(p2p->p2ps_prov->adv_mac, msg->adv_mac)) {
p2p_dbg(p2p,
"Ignore PD Response with unexpected Advertisement MAC");
return -1;
@@ -1396,7 +1395,7 @@
* was sent earlier, we reset that state info here.
*/
if (p2p->user_initiated_pd &&
- os_memcmp(p2p->pending_pd_devaddr, sa, ETH_ALEN) == 0)
+ ether_addr_equal(p2p->pending_pd_devaddr, sa))
p2p_reset_pending_pd(p2p);
if (msg.wps_config_methods != req_config_methods) {
@@ -1758,8 +1757,8 @@
struct p2p_device *dev;
dl_list_for_each(dev, &p2p->devices, struct p2p_device, list) {
- if (os_memcmp(p2p->pending_pd_devaddr,
- dev->info.p2p_device_addr, ETH_ALEN))
+ if (!ether_addr_equal(p2p->pending_pd_devaddr,
+ dev->info.p2p_device_addr))
continue;
if (!dev->req_config_methods)
continue;
diff --git a/src/p2p/p2p_sd.c b/src/p2p/p2p_sd.c
index b9e753f..d6882e4 100644
--- a/src/p2p/p2p_sd.c
+++ b/src/p2p/p2p_sd.c
@@ -79,8 +79,7 @@
count++;
}
if (!q->for_all_peers &&
- os_memcmp(q->peer, dev->info.p2p_device_addr, ETH_ALEN) ==
- 0)
+ ether_addr_equal(q->peer, dev->info.p2p_device_addr))
goto found;
}
@@ -289,8 +288,7 @@
if (query == NULL)
return -1;
if (p2p->state == P2P_SEARCH &&
- os_memcmp(p2p->sd_query_no_ack, dev->info.p2p_device_addr,
- ETH_ALEN) == 0) {
+ ether_addr_equal(p2p->sd_query_no_ack, dev->info.p2p_device_addr)) {
p2p_dbg(p2p, "Do not start Service Discovery with " MACSTR
" due to it being the first no-ACK peer in this search iteration",
MAC2STR(dev->info.p2p_device_addr));
@@ -491,12 +489,21 @@
u16 slen;
u16 update_indic;
- if (p2p->state != P2P_SD_DURING_FIND || p2p->sd_peer == NULL ||
- os_memcmp(sa, p2p->sd_peer->info.p2p_device_addr, ETH_ALEN) != 0) {
+ if ((p2p->state != P2P_SD_DURING_FIND && p2p->state != P2P_SEARCH) ||
+ !p2p->sd_peer ||
+ !ether_addr_equal(sa, p2p->sd_peer->info.p2p_device_addr)) {
p2p_dbg(p2p, "Ignore unexpected GAS Initial Response from "
MACSTR, MAC2STR(sa));
return;
}
+ if (p2p->state == P2P_SEARCH) {
+ /* It is possible for the TX status and RX response events to be
+ * reordered, so assume the request was ACKed if a response is
+ * received. */
+ p2p_dbg(p2p,
+ "GAS Initial Request had not yet received TX status - process the response anyway");
+ p2p_set_state(p2p, P2P_SD_DURING_FIND);
+ }
p2p->cfg->send_action_done(p2p->cfg->cb_ctx);
p2p_clear_timeout(p2p);
@@ -642,7 +649,7 @@
p2p_dbg(p2p, "No pending SD response fragment available");
return;
}
- if (os_memcmp(sa, p2p->sd_resp_addr, ETH_ALEN) != 0) {
+ if (!ether_addr_equal(sa, p2p->sd_resp_addr)) {
p2p_dbg(p2p, "No pending SD response fragment for " MACSTR,
MAC2STR(sa));
return;
@@ -707,7 +714,7 @@
wpa_hexdump(MSG_DEBUG, "P2P: RX GAS Comeback Response", data, len);
if (p2p->state != P2P_SD_DURING_FIND || p2p->sd_peer == NULL ||
- os_memcmp(sa, p2p->sd_peer->info.p2p_device_addr, ETH_ALEN) != 0) {
+ !ether_addr_equal(sa, p2p->sd_peer->info.p2p_device_addr)) {
p2p_dbg(p2p, "Ignore unexpected GAS Comeback Response from "
MACSTR, MAC2STR(sa));
return;