tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ifconfig not waiting for DAD completion



When my wm(4) interface goes from down to up, it first enters a 'detached'
state for 1s or so, then the carrier is detected and the interface goes to the
ipv6 'tentative' state.

The detached state is long enough for ifconfig -w in /etc/rc.d/network to not
wait at all for DAD (the interface is still 'detached' when ifconfig -w runs).

This then leads to unexpected delays (~30s) in e.g. /etc/rc.d/mountall with an
NFS filesystem. (The machine is in ip6mode=host).

I tried the following quick patch to ifconfig(8) so that ifconfig -w waits for
DAD completion only once DAD has started. Does this look like the proper fix?

Index: sbin/ifconfig/af_inet6.c
===================================================================
RCS file: /cvsroot/src/sbin/ifconfig/af_inet6.c,v
retrieving revision 1.33
diff -u -r1.33 af_inet6.c
--- sbin/ifconfig/af_inet6.c  12 May 2015 14:05:29 -0000      1.33
+++ sbin/ifconfig/af_inet6.c  27 Nov 2015 00:05:46 -0000
@@ -489,7 +489,7 @@
        ifr.ifr_addr = *(struct sockaddr_in6 *)ifa->ifa_addr;
        if (prog_ioctl(s, SIOCGIFAFLAG_IN6, &ifr) == -1)
                err(EXIT_FAILURE, "SIOCGIFAFLAG_IN6");
-       return ifr.ifr_ifru.ifru_flags6 & IN6_IFF_TENTATIVE ? true : false;
+       return ifr.ifr_ifru.ifru_flags6 & (IN6_IFF_TENTATIVE|IN6_IFF_DETACHED) ? true : false;
 }
 
 static void


Home | Main Index | Thread Index | Old Index