diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2011-01-12 22:14:56 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-13 21:49:56 -0800 |
commit | 51e7eed79c41180919ff94942895ba38467d9ad4 (patch) | |
tree | 7779a12f1a54d0d205c0ceec14cc2c59ba581c3d /include | |
parent | 5cd8a77df3e9916069787365a32918caa371fc16 (diff) | |
download | linux-51e7eed79c41180919ff94942895ba38467d9ad4.tar.gz linux-51e7eed79c41180919ff94942895ba38467d9ad4.tar.bz2 linux-51e7eed79c41180919ff94942895ba38467d9ad4.zip |
etherdevice.h: Add is_unicast_ether_addr function
From a check for !is_multicast_ether_addr it is not always obvious that
we're checking for a unicast address. So add this helper function to
make those code paths easier to read.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/etherdevice.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index bec8b82889bf..ab68f785fd19 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -99,6 +99,17 @@ static inline int is_broadcast_ether_addr(const u8 *addr) } /** + * is_unicast_ether_addr - Determine if the Ethernet address is unicast + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Return true if the address is a unicast address. + */ +static inline int is_unicast_ether_addr(const u8 *addr) +{ + return !is_multicast_ether_addr(addr); +} + +/** * is_valid_ether_addr - Determine if the given Ethernet address is valid * @addr: Pointer to a six-byte array containing the Ethernet address * |