From: Jouni Malinen Date: Sat, 13 Jan 2024 21:05:52 +0000 (+0200) Subject: Introduce ether_addr_equal() X-Git-Tag: hostap_2_11~507 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95123ab3b38ed8ac5238c9766ac8a7c3fdf9038b;p=thirdparty%2Fhostap.git Introduce ether_addr_equal() 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 --- diff --git a/src/utils/common.h b/src/utils/common.h index bede21e57..ce17c8011 100644 --- a/src/utils/common.h +++ b/src/utils/common.h @@ -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"