I’m using -current built a few days ago, and the included dhcpcd 6.5.0.
I’m using DHCPv6 to get a prefix delegation from my provider’s cable modem.
This works, right up until the delegation’s lifetime expires. And then the link
route disappears.
It took me a while to figure out what was going on, here. When dhcpcd first
acquires the PD lease, it adds an inet6 address for each interface for which
I’ve told it to do so.
dhcpcd.conf (excerpts):
ipv6only
noipv6rs
interface wm0
ia_pd 1 wm1/2
'ifconfig -L wm1' shows reasonable values for pltime and vltime. A /64 route is
also added to the routing table for the link:
aaaa:bbbb:cccc:ddf2::/64 link#2 UC
- - - wm1
After 1/4 of the delegation lifetime, dhcpcd renews the lease, and updates the
vltime and pltime of the inet6 address on the interface appropriately. However,
after the initial lease timeout, the link#2 route will disappear (and the
similar routes for the other interfaces that I’m delegating a /64 to also
disappear; I omitted all but one in the config excerpt above). At this point,
the interface is unable to speak IPv6 to the local network. It’s as if the link
route is given the initial expiration time, but never updated.
However, 'netstat -r' shows 0 for the expiration time!
aaaa:bbbb:cccc:ddf2::/64 link#2 UC
- - - wm1
expire 0 recvpipe 0 sendpipe 0
ssthresh 0L rtt 0L rttvar 0L
hopcount 0L
This behavior is the same whether or not I set ipv6ra_own on the interfaces in
question in dhcpcd.conf. The only way that I’ve been able to keep my nets up is
to hack dhcpcd to set the vltime to infinity on the delegated-address
interfaces:
Index: external/bsd/dhcpcd/dist/if-bsd.c
===================================================================
RCS file: /cvsroot/src/external/bsd/dhcpcd/dist/if-bsd.c,v
retrieving revision 1.11
diff -u -r1.11 if-bsd.c
--- external/bsd/dhcpcd/dist/if-bsd.c 6 Oct 2014 18:22:29 -0000 1.11
+++ external/bsd/dhcpcd/dist/if-bsd.c 28 Oct 2014 01:49:35 -0000
@@ -616,6 +618,7 @@
ADDADDR(&ifa.ifra_prefixmask, &mask);
ifa.ifra_lifetime.ia6t_vltime = a->prefix_vltime;
ifa.ifra_lifetime.ia6t_pltime = a->prefix_pltime;
+ ifa.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
#undef ADDADDR
r = ioctl(s, action < 0 ? SIOCDIFADDR_IN6 : SIOCAIFADDR_IN6, &ifa);
While this is obviously pretty bogus, setting the interface vltime to infinite
does cause the route to stick around in the routing table, so things generally
work. So what’s going wrong? Is this the kernel’s fault for not continuing to
propagate expiration time from the interface to the route—and not showing it at
all in netstat -r? Or is dhcpcd not setting something correctly?
Thanks,
- Geoff