Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bonding: use is_zero_ether_addr

Remove bogus non-portable possibly unaligned way of testing
for zero addres..

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stephen Hemminger and committed by
David S. Miller
5c5129b5 373500db

+2 -2
+2 -2
drivers/net/bonding/bond_sysfs.c
··· 33 33 #include <linux/ctype.h> 34 34 #include <linux/inet.h> 35 35 #include <linux/rtnetlink.h> 36 + #include <linux/etherdevice.h> 36 37 #include <net/net_namespace.h> 37 38 38 39 #include "bonding.h" ··· 276 275 /* If this is the first slave, then we need to set 277 276 the master's hardware address to be the same as the 278 277 slave's. */ 279 - if (!(*((u32 *) & (bond->dev->dev_addr[0])))) { 278 + if (is_zero_ether_addr(bond->dev->dev_addr)) 280 279 memcpy(bond->dev->dev_addr, dev->dev_addr, 281 280 dev->addr_len); 282 - } 283 281 284 282 /* Set the slave's MTU to match the bond */ 285 283 original_mtu = dev->mtu;