diff options
| author | Anton Altaparmakov <aia21@cantab.net> | 2005-10-30 16:00:04 -0500 |
|---|---|---|
| committer | Anton Altaparmakov <aia21@cantab.net> | 2005-10-30 16:00:04 -0500 |
| commit | 07b188ab773e183871e57b33ae37bf635c9f12ba (patch) | |
| tree | 311df8a0dd12fb7bd3e9b5b1a5ca500f0428d679 /include/linux/etherdevice.h | |
| parent | 47c564e10f219f867bdb49225972749a43485a47 (diff) | |
| parent | 9f75e1eff3edb2bb07349b94c28f4f2a6c66ca43 (diff) | |
Merge branch 'master' of /usr/src/ntfs-2.6/
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) | |||
| 104 | addr [0] &= 0xfe; /* clear multicast bit */ | 104 | addr [0] &= 0xfe; /* clear multicast bit */ |
| 105 | addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ | 105 | addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ |
| 106 | } | 106 | } |
| 107 | |||
| 108 | /** | ||
| 109 | * compare_ether_addr - Compare two Ethernet addresses | ||
| 110 | * @addr1: Pointer to a six-byte array containing the Ethernet address | ||
| 111 | * @addr2 Pointer other six-byte array containing the Ethernet address | ||
| 112 | * | ||
| 113 | * Compare two ethernet addresses, returns 0 if equal | ||
| 114 | */ | ||
| 115 | static inline unsigned compare_ether_addr(const u8 *_a, const u8 *_b) | ||
| 116 | { | ||
| 117 | const u16 *a = (const u16 *) _a; | ||
| 118 | const u16 *b = (const u16 *) _b; | ||
| 119 | |||
| 120 | BUILD_BUG_ON(ETH_ALEN != 6); | ||
| 121 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; | ||
| 122 | } | ||
| 107 | #endif /* __KERNEL__ */ | 123 | #endif /* __KERNEL__ */ |
| 108 | 124 | ||
| 109 | #endif /* _LINUX_ETHERDEVICE_H */ | 125 | #endif /* _LINUX_ETHERDEVICE_H */ |
