uml: improve checking and diagnostics of ethernet MACs

Improve checking and diagnostics for broadcast and multicast Ethernet MAC
addresses, and distinguish between those cases in output; also make sure the
device is assigned a MAC address valid only locally to avoid collisions.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Paolo 'Blaisorblade' Giarrusso 2007-05-06 14:51:13 -07:00 committed by Linus Torvalds
parent 85ee2ce8ae
commit e024715f5f
2 changed files with 41 additions and 9 deletions

View file

@ -70,6 +70,18 @@ static inline int is_multicast_ether_addr(const u8 *addr)
return (0x01 & addr[0]);
}
/**
* is_local_ether_addr - Determine if the Ethernet address is locally-assigned
* one (IEEE 802).
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is a local address.
*/
static inline int is_local_ether_addr(const u8 *addr)
{
return (0x02 & addr[0]);
}
/**
* is_broadcast_ether_addr - Determine if the Ethernet address is broadcast
* @addr: Pointer to a six-byte array containing the Ethernet address