On 10/2/19 4:21 PM, Eric Dumazet wrote:
> o syzbot this time, but complete lack of connectivity on some of my test 
> hosts.
> 
> Incoming IPv6 packets go to ip6_forward() (!!!) and are dropped there.

what does 'ip -6 addr sh' show when it is in this state? Any idea of the
order of events?

> 
> There seems to be something missing.
> 
> ifp->state stays at INET6_IFADDR_STATE_PREDAD instead of 
> INET6_IFADDR_STATE_DAD
> 

My original suggestion to Rajendra was this:

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 6a576ff92c39..5ec795086432 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4032,6 +4032,12 @@ static void addrconf_dad_work(struct work_struct *w)

        rtnl_lock();

+       /* device was taken down before this delayed work function
+        * could be canceled
+        */
+       if (!(idev->dev->flags & IFF_UP))
+               goto out;
+
        spin_lock_bh(&ifp->lock);
        if (ifp->state == INET6_IFADDR_STATE_PREDAD) {
                action = DAD_BEGIN;


I flipped to IF_READY based on addrconf_ifdown and idev checks seeming
more appropriate.

Reply via email to