Received: by 10.213.65.68 with SMTP id h4csp2115641imn; Sun, 8 Apr 2018 20:06:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx49yNUqDCJ1eHp6Hlrt2hp1JjXTZ8cBI4oe/25wI/tkzKOlxoZxdGkfV/GYpVk9S25L8qTZp X-Received: by 2002:a17:902:aa03:: with SMTP id be3-v6mr13939235plb.299.1523243180271; Sun, 08 Apr 2018 20:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243180; cv=none; d=google.com; s=arc-20160816; b=XWtU7tYaqRH1uWhsBh1khsnnLclYSuSWfgQFjM0nkE12AJ1mreTvyret7YXTe8OlIP 7+ppj56ChWJpuZa5Al9WQ5pBK9wwkMP2gJr+gf5YKJSQyiOLbUThKdYSlrupxAF7K3XV 8kjO7T+rohvb5IwBmVAefYbEVW7yZngutwPq76ccOirWrcbALy7DTUnAheFwkJ0zR/Cn WuQlGKk0/bGvX6uKh3g6PnmWV0kXpLVYOvtyDQnSHd2SWgQCBpS4e9quBUHfr6RohDgV QAOTEa6ULUo1Nwz83vN1xiViHYL6fvYvAc6yr6CsXSYuPywrQaHHgY5/OAps/VUKgmL8 ygNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=nd076g7Pbf34je0RcrYRbrVdGt4Elg7sZIT+QkNfKyo=; b=QRq2Uq0MOyi3xScNKdDrarGAORyWHELIP9d3tJRixUeEXC59SimGaLPD9232VK26Mj CCMDvJpTZVRYXR9YMsRxzSMJah5VIX4BWea7kBNPsd7tX644BCH0B3ohXhcnvv7jrSNN gkmWODuvWMG9nhwZyy+MAk/ELGUJlcYhtn5lpzVMOHKqd6Ny4rGDQEdLGXBBhESrZkl2 xOt9XwrNUQtz8JIhiunuR5/bJU+MuTxgtgl2gv7GSYpDrOJnDmmVmmrI3yBRYclrbYw4 wDkWGx4FDLSyRvAUr6sbI6xDX4Dov02GeVyzuYRSHFH530CzQD3XvGNvdLi/LBzQaQme Ww8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=n3kAoN+/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc1-v6si3588637plb.689.2018.04.08.20.05.43; Sun, 08 Apr 2018 20:06:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=n3kAoN+/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756071AbeDIAaZ (ORCPT + 99 others); Sun, 8 Apr 2018 20:30:25 -0400 Received: from mail-sn1nam02on0125.outbound.protection.outlook.com ([104.47.36.125]:10314 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755753AbeDIAaT (ORCPT ); Sun, 8 Apr 2018 20:30:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nd076g7Pbf34je0RcrYRbrVdGt4Elg7sZIT+QkNfKyo=; b=n3kAoN+/J6xb7XPzGybd+HnEjJzyJzE8nqrPHthq8NWWyFZPaetmHFvQFG+pJF4RpaIzbairZWjvNsxOzuYlPXpFj4amXuGLOrzG6w9+oqx/92zdcY401RA8jNBcWwclhSsU5MO0XB/XVak4qWq5AewW+0CwjJTrOg+Pdkz1Fz8= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:30:15 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:30:15 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Vlad Yasevich , Vladislav Yasevich , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 124/293] macvlan: Do not return error when setting the same mac address Thread-Topic: [PATCH AUTOSEL for 4.9 124/293] macvlan: Do not return error when setting the same mac address Thread-Index: AQHTz5kf7HX3Ie/nQES2Jo7EPlrEug== Date: Mon, 9 Apr 2018 00:24:29 +0000 Message-ID: <20180409002239.163177-124-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1032;7:G/muW76c0YAOdYKR7KtM8cDDUPo+aTYRAtqkGsyHk51kwsSYy01L7bmivSaK03Fc9aD3pjCXIhmiuD+hAb8zzy3obLVhk2SBcwh/VZMcbT+QEN2FbYe4nsq5CCmt415YSW9CV5e3hPu92BDcS2bslYEGvymowpVbag/037dI6ecIdynQIM8fQ4W1E1BhFk5k7vLMJ77R5cYndgDKJ8ZfBryAS5seoejYdDZckej+l/yU3aAxvkGltib87tJr2iGR;20:Yvb+Aoy7KP+g0GDxoRak8isanuWnSGiUQORgDjiIJ1hS+9g62U8JQ7cTcseUvpFBStqjNX5c6vYzXlsZfW9io/2qCfCMvh7yuYbW7D2ebOk+7cDu/Fk03jiS+fvEC4pRKqswMHR/w/aBwlUuOUls6dQsVbvi8z+dj5XY+uArpX0= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 48d852e0-9c65-400c-b6e3-08d59db11080 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1032; x-ms-traffictypediagnostic: DM5PR2101MB1032: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231221)(944501327)(52105095)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1032;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1032; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(346002)(396003)(39860400002)(376002)(366004)(189003)(199004)(5660300001)(76176011)(99286004)(10090500001)(2900100001)(105586002)(305945005)(7736002)(107886003)(2501003)(5250100002)(14454004)(53936002)(4326008)(8936002)(68736007)(25786009)(86612001)(3846002)(66066001)(1076002)(486006)(316002)(72206003)(22452003)(106356001)(186003)(97736004)(6436002)(6116002)(476003)(2616005)(39060400002)(478600001)(6486002)(10290500003)(2906002)(110136005)(54906003)(6512007)(81156014)(81166006)(8676002)(36756003)(11346002)(3660700001)(446003)(6666003)(86362001)(26005)(102836004)(575784001)(3280700002)(6506007)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1032;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: EOn5wQa3608ic3G0qKFCgPTx7RIgFXrmPzoNugI45zs7QHJnI6+m+7rOh8omXq50iMLsv0XBj+72ahzv+tmEY58XjEyOI1YXKHKUhf5UrFMjV/2ADOabmZdDI72OEAUHobljTeKmssWnmjdyPNAw5MbJLuDeebEVQJh0wIJk6kX5WOLQ5g1L1oZnEW3BWkY5NQcLRr1huSccSu8nR8WJNg3HNVh1SNws9VdH2xIMrYA0Z2no0i8NAqulP5r07+sEoqFCCX1OwTt8ed0+IfAtEcZLyyVilt3RILuW8wr9QzTSctMgSgcgvgzW5uX+qMZt0tLOdhLSty9MuBc+F0Rk+0ibmAK6CgRJizG2kKSYdQmWoRPX5gii4rUcr8pw1OiVN+7s60hjspn7F/zD7edBBV3rz0+fjVsRGmzpaP6mGKA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48d852e0-9c65-400c-b6e3-08d59db11080 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:24:29.6906 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1032 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vlad Yasevich [ Upstream commit e26f43faa0d79dd06e9e94829696b68b9940c2ee ] The user currently gets an EBUSY error when attempting to set the mac address on a macvlan device to the same value. This should really be a no-op as nothing changes. Catch the condition and return early. Signed-off-by: Vladislav Yasevich Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/macvlan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index e8ad4d060da7..3d2cfa5e824a 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -705,6 +705,10 @@ static int macvlan_set_mac_address(struct net_device *= dev, void *p) if (!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; =20 + /* If the addresses are the same, this is a no-op */ + if (ether_addr_equal(dev->dev_addr, addr->sa_data)) + return 0; + if (vlan->mode =3D=3D MACVLAN_MODE_PASSTHRU) { dev_set_mac_address(vlan->lowerdev, addr); return 0; --=20 2.15.1