From patchwork Thu Oct 5 17:03:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matteo Croce X-Patchwork-Id: 821966 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y7JxY05jHz9t2l for ; Fri, 6 Oct 2017 04:03:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbdJERDK (ORCPT ); Thu, 5 Oct 2017 13:03:10 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:51086 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751144AbdJERDJ (ORCPT ); Thu, 5 Oct 2017 13:03:09 -0400 Received: by mail-wm0-f54.google.com with SMTP id u138so3292361wmu.5 for ; Thu, 05 Oct 2017 10:03:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=iUY2ZFxyZzRhSxCmGzNnwtuVQMyWGxBEFg6rAL+/mZ4=; b=D3qOsYBVayiSe0Iu5RfmtER21bA/h8C1mWD1SNCA7+oS4dA7Uld3HQ/K4CH6l/oDrU tM7OapjJYXubRrcaiYA2ncgoZNAsx3T4R7mGGra3DfhXsvWm9zPWvoe46e2GMzdPHQUD QrOuDL3zSQ5gnuUJmgrd5GA7mXLINWx36ITj0s35lCE7nuJm1LbcrK7IVoqBBGIkHPYu CfqH45Dws+K9rvjA2JdyjuDLjP4+Guq1xD16zn7SMkWIeJaEM9YnJHBrCuInx0FFvcSZ YReL0Eno5VXI8qf8XSmd5bdIzWVG76wgSlH9/hTiEmDEdDzi/OtvQwsGADZgkJwofQv3 LJZA== X-Gm-Message-State: AMCzsaW86B+h39aqIqkGaL8dQezFCtCrMZqAnSAfjSaF/9Kfls2OaZuC kj6vc5HLScr50H5DrZoUAgfKyDIVTXs= X-Google-Smtp-Source: AOwi7QC/IcxhpIonBNkpfw7Q8S1dM3ruf10xSssjBz38CEW055X5Txfj//jcb0wzF5zeyLVntkSauA== X-Received: by 10.28.236.203 with SMTP id h72mr12996326wmi.147.1507222987642; Thu, 05 Oct 2017 10:03:07 -0700 (PDT) Received: from mcroce.mxp.redhat.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id i16sm11324405wrf.19.2017.10.05.10.03.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Oct 2017 10:03:06 -0700 (PDT) From: Matteo Croce To: netdev@vger.kernel.org, Erik Kline Subject: [PATCH] ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real Date: Thu, 5 Oct 2017 19:03:05 +0200 Message-Id: <20171005170305.30065-1-mcroce@redhat.com> X-Mailer: git-send-email 2.13.6 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 35e015e1f577 ("ipv6: fix net.ipv6.conf.all interface DAD handlers") was intended to affect accept_dad flag handling in such a way that DAD operation and mode on a given interface would be selected according to the maximum value of conf/{all,interface}/accept_dad. However, addrconf_dad_begin() checks for particular cases in which we need to skip DAD, and this check was modified in the wrong way. Namely, it was modified so that, if the accept_dad flag is 0 for the given interface *or* for all interfaces, DAD would be skipped. We have instead to skip DAD if accept_dad is 0 for the given interface *and* for all interfaces. Fixes: 35e015e1f577 ("ipv6: fix net.ipv6.conf.all interface DAD handlers") Acked-by: Stefano Brivio Signed-off-by: Matteo Croce Reported-by: Erik Kline --- net/ipv6/addrconf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 96861c702c06..4a96ebbf8eda 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -3820,8 +3820,8 @@ static void addrconf_dad_begin(struct inet6_ifaddr *ifp) goto out; if (dev->flags&(IFF_NOARP|IFF_LOOPBACK) || - dev_net(dev)->ipv6.devconf_all->accept_dad < 1 || - idev->cnf.accept_dad < 1 || + (dev_net(dev)->ipv6.devconf_all->accept_dad < 1 && + idev->cnf.accept_dad < 1) || !(ifp->flags&IFA_F_TENTATIVE) || ifp->flags & IFA_F_NODAD) { bump_id = ifp->flags & IFA_F_TENTATIVE;