From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mahesh Bandewar Subject: Re: [PATCH net] ipvlan: fix addr hash list corruption Date: Wed, 25 Mar 2015 11:11:47 -0700 Message-ID: References: <20150324180628.278017fb@griffin> <20150325095851.1d8d1622@griffin> <20150325.114622.1915164845375005128.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: jbenc@redhat.com, linux-netdev , dcbw@redhat.com To: David Miller Return-path: Received: from mail-ob0-f180.google.com ([209.85.214.180]:36718 "EHLO mail-ob0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbbCYSMI (ORCPT ); Wed, 25 Mar 2015 14:12:08 -0400 Received: by obdfc2 with SMTP id fc2so26185383obd.3 for ; Wed, 25 Mar 2015 11:12:08 -0700 (PDT) In-Reply-To: <20150325.114622.1915164845375005128.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Mar 25, 2015 at 8:46 AM, David Miller wrote: > From: Jiri Benc > Date: Wed, 25 Mar 2015 09:58:51 +0100 > >> On Tue, 24 Mar 2015 16:16:38 -0700, Mahesh Bandewar wrote: >>> Well, we already have hlist_unhashed().The following patch should fix >>> the duplicate addition as well as deletion. Please give it a try. >> >> Good idea, it's surely better than adding a new boolean. >> >> However, I'm wondering that when there's apparently no problem with the >> addresses being on the hash list when interface is down, what's the >> point in clearing the hash list in the ndo_stop handler and >> repopulating it in ndo_open? >> >> The following patch fixes the problem, too, and as a bonus removes code: > > I'll let Mahesh reply to this. Yes functionally you will get the same result. However during the RX processing, that code helps ipvlan-demux machine along with packet-dispatcher to determine it early to drop the packet rather than later. Also note that addition / deletion of address entries in hash-table is done in control-path while the demux / dispatcher operate in data-path. So for this reason I would prefer to leave the hash-table entries addition / deletion as it is. --mahesh..