Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3996264imm; Mon, 14 May 2018 00:40:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrX8TlnIMQ0TEdZbJgXKx+oYJiuivKkRfzgdHOmM9vzJKgQm092sIKiPN7ozIuCB64uUC5u X-Received: by 2002:a65:4acd:: with SMTP id c13-v6mr7740990pgu.32.1526283610612; Mon, 14 May 2018 00:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526283610; cv=none; d=google.com; s=arc-20160816; b=g56beFcFLyFQPYkXcxH0yiD9qYBCW+ohomJ6mILo0KlqBkusxeGqbZr6UZS05QC8cd l7d59nQFzGw2qfb3Akb3bCSr+qkhte9pqI+LzyVL9sOO7JvEhhHOc3gR7xVkqBE6eYzx 1MW+wty1Zj8k8yLTE1JlDmS8V2seAn/jcjVy5DngOCvKonBGJWw4TDlSgMe1QcGSPQgG yRjjggoNPOTmuWcoMDkHqSxQvDGGXgirGo/md+VTOxNG/BqRgTtg9tOKcCiNcy1w8qcM JdqZQOcKX/vpmG+epAeDzdeSZ/bj6t8nkGTdvzOXdwwSmvCbtMvs9lXZyG7NaPzgTJwV PkoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=LJPrfBTCAI8nMz9gM5aaQQiBCUKjo/iCnD6xRs3YFRQ=; b=E7IH2QOpJIJY9tumkKRB62S75zjnJZ/eJfWdM7GTtLi8jCaH2QhsZGZyvEAlK8sAkS HXdsXZwJohrB1rVKl5HfhHLvR5zGZiLRJCTz6qO+PGFWiq/Slkxpy1GOo154XWWUsCH0 X/vBFIHF9lyrj4cIvG95OZHuXH7WUNMVrfL7PPuCnnI5a4Saim79m+RzDFGSm4mlWR+T IF+SqwXSDd4Hy+LSC8dp2tdrdTnSjkpguz18qWUS4BGmU10N8PcGJtsQ5OwuSLjjh+5Y KvkSKb78LKQIImvNRQaDEiBEY8bzPf0Ufajk2e+u6Ah1Xg4i/YVpfXTMucd02YuAUBx0 Se0w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 63-v6si9590716plf.524.2018.05.14.00.39.56; Mon, 14 May 2018 00:40:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752918AbeENHjr (ORCPT + 99 others); Mon, 14 May 2018 03:39:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43028 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752732AbeENHjo (ORCPT ); Mon, 14 May 2018 03:39:44 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 488BB406E897; Mon, 14 May 2018 07:39:44 +0000 (UTC) Received: from wlan-180-238.mxp.redhat.com (wlan-180-238.mxp.redhat.com [10.32.180.238]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED84F2024CA5; Mon, 14 May 2018 07:39:41 +0000 (UTC) Message-ID: <1526283581.4411.2.camel@redhat.com> Subject: Re: [PATCH] ipvlan: flush arp table when mac address changed From: Paolo Abeni To: liuqifa@huawei.com, davem@davemloft.net, dsahern@gmail.com, maheshb@google.com, weiyongjun1@huawei.com, maowenan@huawei.com, dingtianhong@huawei.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 14 May 2018 09:39:41 +0200 In-Reply-To: <20180512110037.9116-1-liuqifa@huawei.com> References: <20180512110037.9116-1-liuqifa@huawei.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 14 May 2018 07:39:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 14 May 2018 07:39:44 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pabeni@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Sat, 2018-05-12 at 19:00 +0800, liuqifa@huawei.com wrote: > From: Keefe Liu > > When master device's mac has been changed, the > commit <32c10bbfe914> "ipvlan: always use the current L2 > addr of the master" makes the IPVlan devices's mac changed > also, but it doesn't flush the IPVlan's arp table. > > Signed-off-by: Keefe Liu > --- > drivers/net/ipvlan/ipvlan_main.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c > index 450eec2..a1edfe1 100644 > --- a/drivers/net/ipvlan/ipvlan_main.c > +++ b/drivers/net/ipvlan/ipvlan_main.c > @@ -7,6 +7,8 @@ > * > */ > > +#include > +#include > #include "ipvlan.h" > > static unsigned int ipvlan_netid __read_mostly; > @@ -792,8 +794,10 @@ static int ipvlan_device_event(struct notifier_block *unused, > break; > > case NETDEV_CHANGEADDR: > - list_for_each_entry(ipvlan, &port->ipvlans, pnode) > + list_for_each_entry(ipvlan, &port->ipvlans, pnode) { > ether_addr_copy(ipvlan->dev->dev_addr, dev->dev_addr); > + neigh_changeaddr(&arp_tbl, ipvlan->dev); > + } Why don't using: call_netdevice_notifiers(NETDEV_CHANGEADDR, ipvlan->dev); instead? that is what other stacked device - bridge and vlans - are currently doing in the same scenario. Thanks, Paolo