]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Introduce ether_addr_equal()
authorJouni Malinen <j@w1.fi>
Sat, 13 Jan 2024 21:05:52 +0000 (23:05 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 13 Jan 2024 21:47:20 +0000 (23:47 +0200)
This makes a code more readable for the large number of cases that use
os_memcmp() to check whether two ethernet addresses are equal.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/utils/common.h

index bede21e5717715fd4389bbbd3236fd1215abc0a3..ce17c8011e66c48a0d9cea40b71afc27f6ab65df 100644 (file)
@@ -543,6 +543,11 @@ static inline int is_multicast_ether_addr(const u8 *a)
        return a[0] & 0x01;
 }
 
+static inline bool ether_addr_equal(const u8 *a, const u8 *b)
+{
+       return os_memcmp(a, b, ETH_ALEN) == 0;
+}
+
 #define broadcast_ether_addr (const u8 *) "\xff\xff\xff\xff\xff\xff"
 
 #include "wpa_debug.h"