[PATCH] ipv6: always add flag an address that failed DAD with DADFAILED

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE3901d

3 messages, 3 authors, 2016-01-11 · open the first message on its own page

[PATCH] ipv6: always add flag an address that failed DAD with DADFAILED

From: Lubomir Rintel <lkundrak@v3.sk>
Date: 2016-01-08 12:47:47

The userspace needs to know why is the address being removed so that it can
perhaps obtain a new address.

Without the DADFAILED flag it's impossible to distinguish removal of a
temporary and tentative address due to DAD failure from other reasons (device
removed, manual address removal).

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 net/ipv6/addrconf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 1f21087..9342240 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1772,12 +1772,13 @@ struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, const struct in6_addr *add
 
 static void addrconf_dad_stop(struct inet6_ifaddr *ifp, int dad_failed)
 {
+	if (dad_failed)
+		ifp->flags |= IFA_F_DADFAILED;
+
 	if (ifp->flags&IFA_F_PERMANENT) {
 		spin_lock_bh(&ifp->lock);
 		addrconf_del_dad_work(ifp);
 		ifp->flags |= IFA_F_TENTATIVE;
-		if (dad_failed)
-			ifp->flags |= IFA_F_DADFAILED;
 		spin_unlock_bh(&ifp->lock);
 		if (dad_failed)
 			ipv6_ifa_notify(0, ifp);
-- 
2.5.0

Re: [PATCH] ipv6: always add flag an address that failed DAD with DADFAILED

From: Hannes Frederic Sowa <hidden>
Date: 2016-01-08 13:49:54

On 08.01.2016 13:47, Lubomir Rintel wrote:
The userspace needs to know why is the address being removed so that it can
perhaps obtain a new address.

Without the DADFAILED flag it's impossible to distinguish removal of a
temporary and tentative address due to DAD failure from other reasons (device
removed, manual address removal).

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Makes sense.

Acked-by: Hannes Frederic Sowa <redacted>

Re: [PATCH] ipv6: always add flag an address that failed DAD with DADFAILED

From: David Miller <davem@davemloft.net>
Date: 2016-01-11 03:54:43

From: Lubomir Rintel <lkundrak@v3.sk>
Date: Fri,  8 Jan 2016 13:47:23 +0100
The userspace needs to know why is the address being removed so that it can
perhaps obtain a new address.

Without the DADFAILED flag it's impossible to distinguish removal of a
temporary and tentative address due to DAD failure from other reasons (device
removed, manual address removal).

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help