Skip to contentSkip to conversation

ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real

PATCH Applied Matteo Croce 3 participants 3 messages Oct 5, 2017 – Oct 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: fix net.ipv6.conf.all.accept_dad behaviour for real

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")
---
 net/ipv6/addrconf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/addrconf.c +2 -2
index 96861c702c06..4a96ebbf8eda 100644
@@ -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;
Signature · 1 line
2.13.6
#1 lore raw
Quoted 11 lines · On Thu, 5 Oct 2017 19:03:05 +0200 Matteo Croce <[email protected]> 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.

Quoted 6 lines

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")

This was actually:

Signature · 1 line
Stefano
maintainer Applied
#2 lore raw
In reply to Matteo Croce

From: Matteo Croce <[email protected]>
Date: Thu, 5 Oct 2017 19:03:05 +0200

Quoted 11 lines

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.

Quoted 6 lines

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")

Applied.