From: Anton Nayshtut Date: Tue, 27 Jan 2015 14:30:08 +0000 (+0200) Subject: Add is_multicast_ether_addr() X-Git-Tag: hostap_2_5~422 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36209df93ad9569a86305ac101e4699c9af84655;p=thirdparty%2Fhostap.git Add is_multicast_ether_addr() This helper function can be used to check whether a MAC address is a multicast (including broadcast) address. Signed-off-by: Jouni Malinen --- diff --git a/src/utils/common.h b/src/utils/common.h index 651ce2eb5..6f2cfbabc 100644 --- a/src/utils/common.h +++ b/src/utils/common.h @@ -518,6 +518,11 @@ static inline int is_broadcast_ether_addr(const u8 *a) return (a[0] & a[1] & a[2] & a[3] & a[4] & a[5]) == 0xff; } +static inline int is_multicast_ether_addr(const u8 *a) +{ + return a[0] & 0x01; +} + #define broadcast_ether_addr (const u8 *) "\xff\xff\xff\xff\xff\xff" #include "wpa_debug.h"