]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add is_multicast_ether_addr()
authorAnton Nayshtut <qca_antonn@qca.qualcomm.com>
Tue, 27 Jan 2015 14:30:08 +0000 (16:30 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 16 Jul 2015 09:33:29 +0000 (12:33 +0300)
This helper function can be used to check whether a MAC address is a
multicast (including broadcast) address.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/utils/common.h

index 651ce2eb58262e08b81761b3e2c23afe9fd61425..6f2cfbabc54a25a180faba4290bc497613816ba8 100644 (file)
@@ -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"