瀏覽代碼

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>
Stephen Hemminger 16 年之前
父節點
當前提交
5c5129b54f
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/net/bonding/bond_sysfs.c

+ 2 - 2
drivers/net/bonding/bond_sysfs.c

@@ -33,6 +33,7 @@
 #include <linux/ctype.h>
 #include <linux/ctype.h>
 #include <linux/inet.h>
 #include <linux/inet.h>
 #include <linux/rtnetlink.h>
 #include <linux/rtnetlink.h>
+#include <linux/etherdevice.h>
 #include <net/net_namespace.h>
 #include <net/net_namespace.h>
 
 
 #include "bonding.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
 		/* If this is the first slave, then we need to set
 		   the master's hardware address to be the same as the
 		   the master's hardware address to be the same as the
 		   slave's. */
 		   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,
 			memcpy(bond->dev->dev_addr, dev->dev_addr,
 			       dev->addr_len);
 			       dev->addr_len);
-		}
 
 
 		/* Set the slave's MTU to match the bond */
 		/* Set the slave's MTU to match the bond */
 		original_mtu = dev->mtu;
 		original_mtu = dev->mtu;