netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real
@ 2017-10-05 17:03 Matteo Croce
  2017-10-05 23:27 ` Stefano Brivio
  2017-10-07 22:11 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Matteo Croce @ 2017-10-05 17:03 UTC (permalink / raw)
  To: netdev, Erik Kline

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 <sbrivio@redhat.com>
Signed-off-by: Matteo Croce <mcroce@redhat.com>
---
 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;
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real
  2017-10-05 17:03 [PATCH] ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real Matteo Croce
@ 2017-10-05 23:27 ` Stefano Brivio
  2017-10-07 22:11 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Brivio @ 2017-10-05 23:27 UTC (permalink / raw)
  To: netdev; +Cc: Matteo Croce, Erik Kline

On Thu,  5 Oct 2017 19:03:05 +0200
Matteo Croce <mcroce@redhat.com> wrote:

> 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 <sbrivio@redhat.com>
> Signed-off-by: Matteo Croce <mcroce@redhat.com>

This was actually:

Reported-by: Erik Kline <ek@google.com>


-- 
Stefano

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real
  2017-10-05 17:03 [PATCH] ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real Matteo Croce
  2017-10-05 23:27 ` Stefano Brivio
@ 2017-10-07 22:11 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-10-07 22:11 UTC (permalink / raw)
  To: mcroce; +Cc: netdev, ek

From: Matteo Croce <mcroce@redhat.com>
Date: Thu,  5 Oct 2017 19:03:05 +0200

> 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 <sbrivio@redhat.com>
> Signed-off-by: Matteo Croce <mcroce@redhat.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-07 22:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-05 17:03 [PATCH] ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real Matteo Croce
2017-10-05 23:27 ` Stefano Brivio
2017-10-07 22:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).