summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-01-08 13:47:23 +0100
committerBen Hutchings <ben@decadent.org.uk>2017-10-12 15:27:59 +0100
commit6edc4c03363d583896d54488d9bfbac9be0426b8 (patch)
tree2af062f324655b418c5fc8a305f8f137af2bacb6
parentdfa65e73857556498bc81a0f7347730e2f0325c3 (diff)
downloadlinux-stable-6edc4c03363d583896d54488d9bfbac9be0426b8.tar.gz
linux-stable-6edc4c03363d583896d54488d9bfbac9be0426b8.tar.bz2
linux-stable-6edc4c03363d583896d54488d9bfbac9be0426b8.zip
ipv6: always add flag an address that failed DAD with DADFAILED
commit 3d171f3907329d4b1ce31d5ec9c852c5f0269578 upstream. 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> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--net/ipv6/addrconf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d5fe33752ca6..0e338a072b56 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1610,12 +1610,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);