From patchwork Thu Jun 5 06:50:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Tianhong X-Patchwork-Id: 31397 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9CD2820BF9 for ; Thu, 5 Jun 2014 06:51:33 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id hq11sf3127240vcb.8 for ; Wed, 04 Jun 2014 23:51:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=ltql2fpwa5GRJobmCx8CcNT2UOf/u3W2eBs9A8f/y/c=; b=HJbyEPz1ZuB72ulXdH6P+MTQ0W0aMqeoukBC5CsuUs9lm5Oo8i++jGiWxzHD/IqR1P 8GXBJXTzSZn/OK8WtGs5rnNT/TLxkD4CD1MQg7gU92oIXsOj7VgFVMrZrzwwUEgl040R LxZ2YpU48jnuNb4bpgXJRDomFanZepja4dPvH+KZJb3CQ0wnToJaOfi4fFljWsg8nJfW BW446ogqlRBqdZ3Yw8JNcHF2DAXcJ14oSFqTIdiWB9PMwARXhErPqfnrQ1wRu1MGXR85 6wAwiunaEADpxUi31zuN1X4ojFe9eObH8O4O995xep+yVQC9XZNHPGYXUMrs2nd9jk6S SKkw== X-Gm-Message-State: ALoCoQnhtiS2LmlGMsTgN11kXy7UwIHrsDvCFm53wBZHorJQ+hxqNqtDpox7/qiSiFEsQDS6sgDv X-Received: by 10.52.164.236 with SMTP id yt12mr20186264vdb.8.1401951092158; Wed, 04 Jun 2014 23:51:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.100.179 with SMTP id s48ls9536qge.17.gmail; Wed, 04 Jun 2014 23:51:32 -0700 (PDT) X-Received: by 10.58.143.13 with SMTP id sa13mr155170veb.44.1401951092060; Wed, 04 Jun 2014 23:51:32 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id t7si3278039vef.53.2014.06.04.23.51.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Jun 2014 23:51:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.176 as permitted sender) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id jz11so671478veb.35 for ; Wed, 04 Jun 2014 23:51:32 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr48902967vcg.16.1401951091966; Wed, 04 Jun 2014 23:51:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp102966vcb; Wed, 4 Jun 2014 23:51:31 -0700 (PDT) X-Received: by 10.68.173.65 with SMTP id bi1mr73903438pbc.130.1401951091154; Wed, 04 Jun 2014 23:51:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gu3si10904796pbb.232.2014.06.04.23.51.30; Wed, 04 Jun 2014 23:51:30 -0700 (PDT) Received-SPF: none (google.com: netdev-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751189AbaFEGv0 (ORCPT + 3 others); Thu, 5 Jun 2014 02:51:26 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:25973 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbaFEGvZ (ORCPT ); Thu, 5 Jun 2014 02:51:25 -0400 Received: from 172.24.2.119 (EHLO szxeml209-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BUS39419; Thu, 05 Jun 2014 14:50:44 +0800 (CST) Received: from SZXEML457-HUB.china.huawei.com (10.82.67.200) by szxeml209-edg.china.huawei.com (172.24.2.184) with Microsoft SMTP Server (TLS) id 14.3.158.1; Thu, 5 Jun 2014 14:50:36 +0800 Received: from localhost (10.177.22.246) by szxeml457-hub.china.huawei.com (10.82.67.200) with Microsoft SMTP Server id 14.3.158.1; Thu, 5 Jun 2014 14:50:31 +0800 From: Ding Tianhong To: , , , CC: Subject: [PATCH net-next 2/4] net: dev: don't set the same mac address for netdev Date: Thu, 5 Jun 2014 14:50:26 +0800 Message-ID: <1401951028-9800-3-git-send-email-dingtianhong@huawei.com> X-Mailer: git-send-email 1.8.5.2.msysgit.0 In-Reply-To: <1401951028-9800-1-git-send-email-dingtianhong@huawei.com> References: <1401951028-9800-1-git-send-email-dingtianhong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.22.246] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: netdev@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dingtianhong@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Most of netdev just like bond, team, vlan will set the mac address and propagate to the upperdev or lowerdev regardless the mac address is same or not, I could not find that the same mac address could make affect, so add equal check when set mac address. Signed-off-by: Ding Tianhong --- net/core/dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c index 5367bfb..4008a51 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -5570,6 +5570,8 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa) return -EINVAL; if (!netif_device_present(dev)) return -ENODEV; + if (ether_addr_equal_64bits(dev->dev_addr, sa->sa_data)) + return 0; err = ops->ndo_set_mac_address(dev, sa); if (err) return err;