netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: always add flag an address that failed DAD with DADFAILED
@ 2016-01-08 12:47 Lubomir Rintel
  2016-01-08 13:49 ` Hannes Frederic Sowa
  2016-01-11  3:54 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Lubomir Rintel @ 2016-01-08 12:47 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, Lubomir Rintel

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

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

* Re: [PATCH] ipv6: always add flag an address that failed DAD with DADFAILED
  2016-01-08 12:47 [PATCH] ipv6: always add flag an address that failed DAD with DADFAILED Lubomir Rintel
@ 2016-01-08 13:49 ` Hannes Frederic Sowa
  2016-01-11  3:54 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Frederic Sowa @ 2016-01-08 13:49 UTC (permalink / raw)
  To: Lubomir Rintel, netdev
  Cc: linux-kernel, David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy

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 <hannes@stressinduktion.org>

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

* Re: [PATCH] ipv6: always add flag an address that failed DAD with DADFAILED
  2016-01-08 12:47 [PATCH] ipv6: always add flag an address that failed DAD with DADFAILED Lubomir Rintel
  2016-01-08 13:49 ` Hannes Frederic Sowa
@ 2016-01-11  3:54 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-01-11  3:54 UTC (permalink / raw)
  To: lkundrak; +Cc: netdev, linux-kernel, kuznet, jmorris, yoshfuji, kaber

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.

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

end of thread, other threads:[~2016-01-11  3:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-08 12:47 [PATCH] ipv6: always add flag an address that failed DAD with DADFAILED Lubomir Rintel
2016-01-08 13:49 ` Hannes Frederic Sowa
2016-01-11  3:54 ` 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).