Revert "[wpa_supplicant] cumilative patch from commit 3a5d1a7e6"
Revert submission 26533062-Supplicant_merge_June24
Reason for revert: https://b.corp.google.com/issues/349780869
Reverted changes: /q/submissionid:26533062-Supplicant_merge_June24
Change-Id: I4a7a5b8ccb6b4822353bacc29649587cd5a3cb80
diff --git a/src/wps/wps.c b/src/wps/wps.c
index 7cfebfa..1fe3806 100644
--- a/src/wps/wps.c
+++ b/src/wps/wps.c
@@ -336,9 +336,9 @@
pos = attr.authorized_macs;
for (i = 0; i < attr.authorized_macs_len / ETH_ALEN; i++) {
- if (ether_addr_equal(pos, addr))
+ if (os_memcmp(pos, addr, ETH_ALEN) == 0)
return 2;
- if (ether_addr_equal(pos, bcast))
+ if (os_memcmp(pos, bcast, ETH_ALEN) == 0)
return 1;
pos += ETH_ALEN;
}
diff --git a/src/wps/wps_enrollee.c b/src/wps/wps_enrollee.c
index af828e5..819cd43 100644
--- a/src/wps/wps_enrollee.c
+++ b/src/wps/wps_enrollee.c
@@ -715,7 +715,8 @@
wps_process_cred(&attr, &wps->cred))
return -1;
- if (!ether_addr_equal(wps->cred.mac_addr, wps->wps->dev.mac_addr)) {
+ if (os_memcmp(wps->cred.mac_addr, wps->wps->dev.mac_addr, ETH_ALEN) !=
+ 0) {
wpa_printf(MSG_DEBUG, "WPS: MAC Address in the Credential ("
MACSTR ") does not match with own address (" MACSTR
")", MAC2STR(wps->cred.mac_addr),
@@ -814,7 +815,8 @@
wpa_printf(MSG_INFO, "WPS: Received new AP configuration from "
"Registrar");
- if (!ether_addr_equal(cred.mac_addr, wps->wps->dev.mac_addr)) {
+ if (os_memcmp(cred.mac_addr, wps->wps->dev.mac_addr, ETH_ALEN) !=
+ 0) {
wpa_printf(MSG_DEBUG, "WPS: MAC Address in the AP Settings ("
MACSTR ") does not match with own address (" MACSTR
")", MAC2STR(cred.mac_addr),
diff --git a/src/wps/wps_er.c b/src/wps/wps_er.c
index dede64b..31d2e50 100644
--- a/src/wps/wps_er.c
+++ b/src/wps/wps_er.c
@@ -62,7 +62,7 @@
struct wps_er_sta *sta;
dl_list_for_each(sta, &ap->sta, struct wps_er_sta, list) {
if ((addr == NULL ||
- ether_addr_equal(sta->addr, addr)) &&
+ os_memcmp(sta->addr, addr, ETH_ALEN) == 0) &&
(uuid == NULL ||
os_memcmp(uuid, sta->uuid, WPS_UUID_LEN) == 0))
return sta;
@@ -106,7 +106,7 @@
(uuid == NULL ||
os_memcmp(uuid, ap->uuid, WPS_UUID_LEN) == 0) &&
(mac_addr == NULL ||
- ether_addr_equal(mac_addr, ap->mac_addr)))
+ os_memcmp(mac_addr, ap->mac_addr, ETH_ALEN) == 0))
return ap;
}
return NULL;
diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c
index f49784f..9587293 100644
--- a/src/wps/wps_registrar.c
+++ b/src/wps/wps_registrar.c
@@ -238,7 +238,7 @@
wpa_printf(MSG_DEBUG, "WPS: Add authorized MAC " MACSTR,
MAC2STR(addr));
for (i = 0; i < WPS_MAX_AUTHORIZED_MACS; i++)
- if (ether_addr_equal(reg->authorized_macs[i], addr)) {
+ if (os_memcmp(reg->authorized_macs[i], addr, ETH_ALEN) == 0) {
wpa_printf(MSG_DEBUG, "WPS: Authorized MAC was "
"already in the list");
return; /* already in list */
@@ -259,7 +259,7 @@
wpa_printf(MSG_DEBUG, "WPS: Remove authorized MAC " MACSTR,
MAC2STR(addr));
for (i = 0; i < WPS_MAX_AUTHORIZED_MACS; i++) {
- if (ether_addr_equal(reg->authorized_macs[i], addr))
+ if (os_memcmp(reg->authorized_macs, addr, ETH_ALEN) == 0)
break;
}
if (i == WPS_MAX_AUTHORIZED_MACS) {
@@ -296,7 +296,7 @@
struct wps_registrar_device *dev;
for (dev = reg->devices; dev; dev = dev->next) {
- if (ether_addr_equal(dev->dev.mac_addr, addr))
+ if (os_memcmp(dev->dev.mac_addr, addr, ETH_ALEN) == 0)
return dev;
}
return NULL;
@@ -353,7 +353,7 @@
pbc = reg->pbc_sessions;
while (pbc) {
- if (ether_addr_equal(pbc->addr, addr) &&
+ if (os_memcmp(pbc->addr, addr, ETH_ALEN) == 0 &&
os_memcmp(pbc->uuid_e, uuid_e, WPS_UUID_LEN) == 0) {
if (prev)
prev->next = pbc->next;
@@ -405,7 +405,8 @@
while (pbc) {
if (os_memcmp(pbc->uuid_e, uuid_e, WPS_UUID_LEN) == 0 ||
(p2p_dev_addr && !is_zero_ether_addr(reg->p2p_dev_addr) &&
- ether_addr_equal(reg->p2p_dev_addr, p2p_dev_addr))) {
+ os_memcmp(reg->p2p_dev_addr, p2p_dev_addr, ETH_ALEN) ==
+ 0)) {
if (prev)
prev->next = pbc->next;
else
@@ -2610,7 +2611,7 @@
if (is_zero_ether_addr(reg->p2p_dev_addr))
return 1; /* no filtering in use */
- if (!ether_addr_equal(reg->p2p_dev_addr, wps->p2p_dev_addr)) {
+ if (os_memcmp(reg->p2p_dev_addr, wps->p2p_dev_addr, ETH_ALEN) != 0) {
wpa_printf(MSG_DEBUG, "WPS: No match on P2P Device Address "
"filtering for PBC: expected " MACSTR " was "
MACSTR " - indicate PBC session overlap",
@@ -2631,7 +2632,7 @@
if (is_zero_ether_addr(reg->p2p_dev_addr))
return 0; /* no specific Enrollee selected */
- if (ether_addr_equal(reg->p2p_dev_addr, wps->p2p_dev_addr)) {
+ if (os_memcmp(reg->p2p_dev_addr, wps->p2p_dev_addr, ETH_ALEN) == 0) {
wpa_printf(MSG_DEBUG, "WPS: Skip PBC overlap due to selected "
"Enrollee match");
return 1;