mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
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:
parent
85ee2ce8ae
commit
e024715f5f
2 changed files with 41 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue