aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2019-10-03 14:46:15 -0700
committerDavid S. Miller <davem@davemloft.net>2019-10-04 14:31:10 -0700
commit8ae72cbf62d2c1879456c0c5872f958e18f53711 (patch)
tree25ae03726054fe2b5d77ca5b4dc747fed2845e7f /net
parentnet: make sock_prot_memory_pressure() return "const char *" (diff)
downloadlinux-dev-8ae72cbf62d2c1879456c0c5872f958e18f53711.tar.xz
linux-dev-8ae72cbf62d2c1879456c0c5872f958e18f53711.zip
Revert "ipv6: Handle race in addrconf_dad_work"
This reverts commit a3ce2a21bb8969ae27917281244fa91bf5f286d7. Eric reported tests failings with commit. After digging into it, the bottom line is that the DAD sequence is not to be messed with. There are too many cases that are expected to proceed regardless of whether a device is up. Revert the patch and I will send a different solution for the problem Rajendra reported. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Eric Dumazet <edumazet@google.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv6/addrconf.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index dd3be06d5a06..6a576ff92c39 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4032,12 +4032,6 @@ static void addrconf_dad_work(struct work_struct *w)
rtnl_lock();
- /* check if device was taken down before this delayed work
- * function could be canceled
- */
- if (idev->dead || !(idev->if_flags & IF_READY))
- goto out;
-
spin_lock_bh(&ifp->lock);
if (ifp->state == INET6_IFADDR_STATE_PREDAD) {
action = DAD_BEGIN;
@@ -4083,6 +4077,11 @@ static void addrconf_dad_work(struct work_struct *w)
goto out;
write_lock_bh(&idev->lock);
+ if (idev->dead || !(idev->if_flags & IF_READY)) {
+ write_unlock_bh(&idev->lock);
+ goto out;
+ }
+
spin_lock(&ifp->lock);
if (ifp->state == INET6_IFADDR_STATE_DEAD) {
spin_unlock(&ifp->lock);