From patchwork Sat Jun 13 05:02:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 28656 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 1582FB71F4 for ; Sat, 13 Jun 2009 15:06:41 +1000 (EST) Received: by ozlabs.org (Postfix) id 08855DDD04; Sat, 13 Jun 2009 15:06:41 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 9A684DDD01 for ; Sat, 13 Jun 2009 15:06:40 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754050AbZFMFGS (ORCPT ); Sat, 13 Jun 2009 01:06:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753286AbZFMFGQ (ORCPT ); Sat, 13 Jun 2009 01:06:16 -0400 Received: from suva.vyatta.com ([76.74.103.44]:49229 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbZFMFGO (ORCPT ); Sat, 13 Jun 2009 01:06:14 -0400 Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id n5D55ppV004757; Fri, 12 Jun 2009 22:05:51 -0700 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id n5D55peb004756; Fri, 12 Jun 2009 22:05:51 -0700 Message-Id: <20090613050422.202722960@vyatta.com> References: <20090613050243.100086546@vyatta.com> User-Agent: quilt/0.46-1 Date: Fri, 12 Jun 2009 22:02:51 -0700 From: Stephen Hemminger To: Jay Vosburg , "David S. Miller" Cc: netdev@vger.kernel.org, bonding-devel@lists.sourceforge.net Subject: [PATCH 8/9] bonding: use is_zero_ether_addr Content-Disposition: inline; filename=bond-zeroaddr.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Remove bogus non-portable possibly unaligned way of testing for zero addres.. Signed-off-by: Stephen Hemminger --- a/drivers/net/bonding/bond_sysfs.c 2009-06-12 21:46:35.171609407 -0700 +++ b/drivers/net/bonding/bond_sysfs.c 2009-06-12 21:46:36.103625198 -0700 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "bonding.h" @@ -275,10 +276,9 @@ static ssize_t bonding_store_slaves(stru /* 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;