Received: by 10.213.65.68 with SMTP id h4csp2118105imn; Sun, 8 Apr 2018 20:09:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+2brrHqez472hbrtSv2NMysNXOIXNN6loAMxnFG+6Q8jNy+PWIFwjFXRdP+Y91zno4fDwz X-Received: by 10.101.90.140 with SMTP id c12mr24019407pgt.191.1523243360249; Sun, 08 Apr 2018 20:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243360; cv=none; d=google.com; s=arc-20160816; b=K0KrmMrSX1vHVHhUnP2ST8c8WOb+70/JeL+I8jHUDtC+gzmG4TRTDUMoznnWHl7FQx WZPD+bjtUDQ79tcEATGz3kJpQRXt7FL642i0Uj1klCZl0NngusxfwjvF5hzcoRNVwd7a +kGiFVTDR07Z5l2qVKC4HRcce1HUEimIfPifE76fpENodgt1xQJtrs8OBciHhqJOAc7D GvcFOpKlZAw1RO7BO0hehyeBEsN6+peJcp1l4Tm3evE3qXCa2WhnamUE8zDyP5TbUMIJ 680PylXCy68m/mOEDBi4TagVysF3yqV9lwwn0KnXsBC9DV3uOtO9FLTvonFKblTiJ7qW vdyw== 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=ffBCmqy8ppeP1NHVwDEBLzR270g8OB4goHgQMpBE4bA=; b=zS9K22vFxlX1oz0rMCcR0u+Upy+pH6Kf0mesdhrbvFHk2qxoPaDGS8nGccskOzXME5 256DscrXjmRsp8tWkPoBeek1AVdKetU4nGv4FwaSS0Hp8Tjg6MmGVQAZzNpsWDdr9I4n vpFUWcuJly96ZWSLqO/mtIYCh8iZV7cUaM4GXNXdjgV/2whWsvUiq7++mQeDY7MTGQ0T AEsfmCYWet/YKDYgsKoSpXyJn45D7cdLDzCCz5yVtPWs3V7vWA1ebrXhBxK6ZZ1DY/sA xg7vgRYqQ3Gmd3uC+//fGR38aP/xYGT8/MENPM6+01Vg03ewFz21X7tWRnbLcqOpG92p b3XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=EJsCWKPa; 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 p68si10495774pga.751.2018.04.08.20.08.43; Sun, 08 Apr 2018 20:09: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=EJsCWKPa; 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 S1757607AbeDICAm (ORCPT + 99 others); Sun, 8 Apr 2018 22:00:42 -0400 Received: from mail-sn1nam01on0091.outbound.protection.outlook.com ([104.47.32.91]:51937 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756464AbeDIAcO (ORCPT ); Sun, 8 Apr 2018 20:32:14 -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=ffBCmqy8ppeP1NHVwDEBLzR270g8OB4goHgQMpBE4bA=; b=EJsCWKPa6aJzEBnSG07ipwdKF8ZoXE/F4psVp0B+yHG8i1YvsLRciRxjjv7OIE8MVRcJRhT0xiZdDuAaIvAGv8BHeM19sSdCfvZ3A9I3n+HVNeWMDMDY0CKZIT3ckT1+ukwIA255A/vDYNoD/ePAbBmK5I2xAX9KtblzspWiI50= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0870.namprd21.prod.outlook.com (10.167.110.165) 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:32:08 +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:32:08 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Nikolay Aleksandrov , Roopa Prabhu , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 202/293] bridge: allow ext learned entries to change ports Thread-Topic: [PATCH AUTOSEL for 4.9 202/293] bridge: allow ext learned entries to change ports Thread-Index: AQHTz5lE3KgLy3ufmUO2TVzusc4RZg== Date: Mon, 9 Apr 2018 00:25:31 +0000 Message-ID: <20180409002239.163177-202-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;DM5PR2101MB0870;7:ybf1a9Lgv6vQvXsgxHLRMGKokTLCxhRaluxrPb0BnE1baW2DQUdd27LW4jiTWIi7z2DArByLNuoTyEfB7+UH6z5WES2xa2oh4PZyK6MWyvHD3CkDAZGFFZWbhglxCbMFA69hbjOKqp2VjKqCz57mFqj7gS0cq63G4Q3gAgy4xrcGovm6HIrhPKIdJQCezwqpSMAvwx+43qd5rC/CQqz7674b1qZOKCXSwCYlFleTp7ktRsdZOr5mjPE+FeRyVlg4;20:ojPSfKJCwtb1Cl9jyf6MH5iy7aFCwFIOgQXNWSAQbo9EObgEFDY6Ifmwvi6gVLklqYZBfWU9CNoyJmFFuNaE13qwsus7BtuGUnSPZWGtOWSU1DgREya4TTnbjvEVN/onitJfAf4VIH1f07rA4rerJfmonWIbar+t1qkKt16HnMw= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: f3223c41-9773-49f4-6289-08d59db153ee x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0870; x-ms-traffictypediagnostic: DM5PR2101MB0870: 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); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0870;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0870; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(346002)(39860400002)(366004)(396003)(39380400002)(376002)(199004)(189003)(53936002)(2906002)(6512007)(102836004)(2616005)(76176011)(14454004)(446003)(10090500001)(11346002)(476003)(486006)(107886003)(59450400001)(2900100001)(97736004)(66066001)(6506007)(6436002)(106356001)(99286004)(105586002)(3660700001)(6116002)(86612001)(3280700002)(6666003)(2501003)(10290500003)(26005)(8676002)(8936002)(478600001)(68736007)(5250100002)(5660300001)(316002)(4326008)(72206003)(186003)(110136005)(6486002)(7736002)(25786009)(3846002)(86362001)(36756003)(22452003)(81156014)(81166006)(305945005)(54906003)(1076002)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0870;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: N+OK/+86asFPU2BHGZk/JtfgfyjSUTLVKZK4KicVQxBttXH0QojBKXkomADcE8S9LXdezrw8Ogd319vER/ZiiVX6/FtXSyYzV54UVfIDNg69KLZXK0dTojemYia2fq0iVa0tCfYWJgFeoYD7rxa4Fi7BGHZiXqyfSM4GQNAh20adczi1WbGRlf/b0TOUID+ZPzo2e7R8nRHQyYMJIv8F7KvvtsRlXzpt/LcjsUqcvs4Y1QSXXp1MhBw/blVO8Axj2mZLztvkd8nRibljBLGtT/qTHQBCVZOU4Och6hZhRlNlu4M4geeCseJ4j6pHIUcFWSGvhxmzA8dek2UV0Z0Ye5bTS5t/o2Yyb0uN0ToWGu5uCu6zlkhjnkQJAJ2sCzo1Bf//eOBsBcDGrVjOujPsSNxk9Dm76f3yfTLs5WzNIYE= 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: f3223c41-9773-49f4-6289-08d59db153ee X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:31.8471 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0870 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikolay Aleksandrov [ Upstream commit 7597b266c56feaad7d4e6e65822766e929407da2 ] current code silently ignores change of port in the request message. This patch makes sure the port is modified and notification is sent to userspace. Fixes: cf6b8e1eedff ("bridge: add API to notify bridge driver of learned FB= D on offloaded device") Signed-off-by: Nikolay Aleksandrov Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/bridge/br_fdb.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 6b43c8c88f19..f32b8138f9c8 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -1101,8 +1101,9 @@ void br_fdb_unsync_static(struct net_bridge *br, stru= ct net_bridge_port *p) int br_fdb_external_learn_add(struct net_bridge *br, struct net_bridge_por= t *p, const unsigned char *addr, u16 vid) { - struct hlist_head *head; struct net_bridge_fdb_entry *fdb; + struct hlist_head *head; + bool modified =3D false; int err =3D 0; =20 ASSERT_RTNL(); @@ -1118,14 +1119,25 @@ int br_fdb_external_learn_add(struct net_bridge *br= , struct net_bridge_port *p, } fdb->added_by_external_learn =3D 1; fdb_notify(br, fdb, RTM_NEWNEIGH); - } else if (fdb->added_by_external_learn) { - /* Refresh entry */ - fdb->updated =3D fdb->used =3D jiffies; - } else if (!fdb->added_by_user) { - /* Take over SW learned entry */ - fdb->added_by_external_learn =3D 1; + } else { fdb->updated =3D jiffies; - fdb_notify(br, fdb, RTM_NEWNEIGH); + + if (fdb->dst !=3D p) { + fdb->dst =3D p; + modified =3D true; + } + + if (fdb->added_by_external_learn) { + /* Refresh entry */ + fdb->used =3D jiffies; + } else if (!fdb->added_by_user) { + /* Take over SW learned entry */ + fdb->added_by_external_learn =3D 1; + modified =3D true; + } + + if (modified) + fdb_notify(br, fdb, RTM_NEWNEIGH); } =20 err_unlock: --=20 2.15.1