Use ether_addr_equal() to compare whether two MAC addresses are equal

This was done with spatch using the following semantic patch and minor
manual edits to clean up coding style and avoid compiler warnings in
driver_wext.c:

@@
expression a,b;
@@
-	os_memcmp(a, b, ETH_ALEN) == 0
+	ether_addr_equal(a, b)

@@
expression a,b;
@@
-	os_memcmp(a, b, ETH_ALEN) != 0
+	!ether_addr_equal(a, b)

@@
expression a,b;
@@
-	!os_memcmp(a, b, ETH_ALEN)
+	ether_addr_equal(a, b)

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2024-01-13 23:15:36 +02:00
parent 58027cfecc
commit 2d83d224ff
85 changed files with 460 additions and 497 deletions

View file

@ -2602,8 +2602,7 @@ int wpa_supplicant_filter_bssid_match(struct wpa_supplicant *wpa_s,
return 1;
for (i = 0; i < wpa_s->bssid_filter_count; i++) {
if (os_memcmp(wpa_s->bssid_filter + i * ETH_ALEN, bssid,
ETH_ALEN) == 0)
if (ether_addr_equal(wpa_s->bssid_filter + i * ETH_ALEN, bssid))
return 1;
}