diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 09:59:10 +0300 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 09:59:10 +0300 |
| commit | 9359ede748ff1461bf0632fb4182f61da4a2f9e2 (patch) | |
| tree | 4ec0c92b4998a535fc1180866a6dff9ad3bbb489 /include/linux/etherdevice.h | |
| parent | 35ebbae2836a361330b784706b7140c90a346a53 (diff) | |
| parent | 81cfb8864c73230eb1c37753aba517db15cf4d8f (diff) | |
| download | linux-9359ede748ff1461bf0632fb4182f61da4a2f9e2.tar.xz | |
Merge branch 'upstream'
Diffstat (limited to 'include/linux/etherdevice.h')
| -rw-r--r-- | include/linux/etherdevice.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 4522c7186bf3..cc84934f9059 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -104,6 +104,22 @@ static inline void random_ether_addr(u8 *addr) addr [0] &= 0xfe; /* clear multicast bit */ addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ } + +/** + * compare_ether_addr - Compare two Ethernet addresses + * @addr1: Pointer to a six-byte array containing the Ethernet address + * @addr2 Pointer other six-byte array containing the Ethernet address + * + * Compare two ethernet addresses, returns 0 if equal + */ +static inline unsigned compare_ether_addr(const u8 *_a, const u8 *_b) +{ + const u16 *a = (const u16 *) _a; + const u16 *b = (const u16 *) _b; + + BUILD_BUG_ON(ETH_ALEN != 6); + return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; +} #endif /* __KERNEL__ */ #endif /* _LINUX_ETHERDEVICE_H */ |
