bonding: use is_zero_ether_addr
authorStephen Hemminger <shemminger@vyatta.com>
Fri, 12 Jun 2009 19:02:51 +0000 (19:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 14 Jun 2009 06:29:03 +0000 (23:29 -0700)
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>
drivers/net/bonding/bond_sysfs.c

index 395f3b160a75e9a7e05ea943bc4a418f66a53442..55bf34f59bbf60fe673bd4d4671aa53a03302157 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/ctype.h>
 #include <linux/inet.h>
 #include <linux/rtnetlink.h>
+#include <linux/etherdevice.h>
 #include <net/net_namespace.h>
 
 #include "bonding.h"
@@ -275,10 +276,9 @@ static ssize_t bonding_store_slaves(struct device *d,
                /* If this is the first slave, then we need to set
                   the master's hardware address to be the same as the
                   slave's. */
-               if (!(*((u32 *) & (bond->dev->dev_addr[0])))) {
+               if (is_zero_ether_addr(bond->dev->dev_addr))
                        memcpy(bond->dev->dev_addr, dev->dev_addr,
                               dev->addr_len);
-               }
 
                /* Set the slave's MTU to match the bond */
                original_mtu = dev->mtu;