]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ipv6: always add flag an address that failed DAD with DADFAILED
authorLubomir Rintel <lkundrak@v3.sk>
Fri, 8 Jan 2016 12:47:23 +0000 (13:47 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Oct 2017 14:27:13 +0000 (15:27 +0100)
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>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/ipv6/addrconf.c

index cb1de47d8c2cc59d85d11191dd83701f4624ce52..68236be5f78e89dc353d6458a0d2ed9e44fbb600 100644 (file)
@@ -1382,12 +1382,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_timer(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);