LinuxKPI: add is_unicast_ether_addr()

Needed by mediatek/mt76 wireless driver.

While here adjust the way is_multicast_ether_addr() is implemented
to not look weird. [1]

Sponsored by:	The FreeBSD Foundation
Suggested by:	emaste [1]
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D50152

(cherry picked from commit a4618caa43c16e6e672c27dac1943fd833f8bd8f)
This commit is contained in:
Bjoern A. Zeeb 2025-05-03 23:44:52 +00:00 committed by Franco Fichtner
parent ddb311ffab
commit 2ca8d402df

View file

@ -57,10 +57,16 @@ is_zero_ether_addr(const u8 * addr)
0x00);
}
static inline bool
is_unicast_ether_addr(const u8 * addr)
{
return ((addr[0] & 0x01) == 0x00);
}
static inline bool
is_multicast_ether_addr(const u8 * addr)
{
return (0x01 & addr[0]);
return ((addr[0] & 0x01) == 0x01);
}
static inline bool