Anthony Mallet
2015-11-27 00:29:38 UTC
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
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
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
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de