Roy Marples [Wed, 29 Apr 2020 15:33:57 +0000 (16:33 +0100)]
inet6: Set default ND timers before a RA arrives after preservation
Other OS will just remove the RA's on carrier down and thus set
default values, but not so on NetBSD.
As such as need to set default values just before settings any values
from the incoming RA.
This allows us to change networks sensibly.
Roy Marples [Wed, 29 Apr 2020 13:55:23 +0000 (14:55 +0100)]
NetBSD: Gear up for kernel RA removal.
linkmtu will vanish from nd_ifinfo along with other things.
Also, there is not need to pre-fetch ifinfo because flags are no
longer updated when setting ifinfo back again.
Roy Marples [Sun, 26 Apr 2020 16:22:42 +0000 (17:22 +0100)]
DHCP6: Implement DECLINE support for duplicated addresses
This is the final piece of DHCP6 to implement!
Part of this change drops the use of the IPV6_AF_DUPLICATED flag
and we just use IN6_IFF_DUPLICATED now.
Roy Marples [Sun, 19 Apr 2020 06:52:47 +0000 (07:52 +0100)]
inet6: Add 'temporary' directive to the slaac option
This instructs dhcpcd to create a temporary address for each
address generated from a RA.
As such, dhcpcd no longer looks at the kernel option for it
as the functionality is being removed from some or never existed
in the first place.
Roy Marples [Fri, 17 Apr 2020 12:22:54 +0000 (13:22 +0100)]
inet6: Only log RA's when they are from a new server
We cannot log them normally as there are implementations which
vary the expiry times based on their own times so each message is
different. As such, we only log from new servers or coming back
from expiration.
Roy Marples [Sun, 5 Apr 2020 15:44:32 +0000 (16:44 +0100)]
privsep: Detect a suitable user for dhcpcd, otherwise use dhcpcd
System users generally have _ preceeding their username.
Only use this user if it exists and their home dir is not /var/empty.
Otherwise default to using dhcpcd.
Roy Marples [Fri, 10 Apr 2020 09:17:38 +0000 (10:17 +0100)]
privsep: default to using _dhcpcd and not _dhcp
_dhcp home dir defaults to /var/empty.
System integrators can and should be in charge of changing it when needed.
Packagers on the other hand don't have such a luxury and so should not
use _dhcp by default.
Roy Marples [Thu, 9 Apr 2020 15:16:37 +0000 (16:16 +0100)]
RA: Rework temporary address management
Vastly simpfly how they are generated and managed.
Temporary address generation now uses pure random numbers
rather than MD5ing over a random secret as arc4random should be
random enough. This change reflects RFC 4941bis.
An empty signal mask is probably more appropriate, since most
programs presume that the signal mask is empty when they start
even when they are using signals.
Roy Marples [Sun, 5 Apr 2020 06:47:14 +0000 (07:47 +0100)]
privsep: If we fail to init privsep, continue
We continue if the privsep user cannot be found, so do the same
if passwd or similar is missing from the system.
This helps people who use dhcpcd in ramdisks to oneshot the config
for example to start iSCSI.
Roy Marples [Fri, 3 Apr 2020 18:05:41 +0000 (18:05 +0000)]
Linux: improve IPv6 router reachability
Only mark as unreachable for NUD_FAILED.
Sadly the kernel emits this when the NDP entry is deleted for
whatever reason, which looks like a bug in the kernel.
Shortly after dhcpcd started using these constants, they were dropped from OpenBSD kernel headers as they're only used by rad(8). Switch to dhcpcd's own constants instead, fixing build on recent -current.
Roy Marples [Wed, 1 Apr 2020 12:22:15 +0000 (13:22 +0100)]
resolv.conf: Uniquify contents
We might have >1 router that broadcasts the same DNS information.
While resolvconf(8) can easily take care of uniqifying the data,
not all systems have this nice tool so do the job here as well.
Roy Marples [Tue, 31 Mar 2020 19:21:58 +0000 (20:21 +0100)]
dhcpcd: disable address sanitization by default
As recent production kernels ship with ASLR by default which
stops dhcpcd running dead when this is enabled.
We dont want to break a systems boot, so force it via configure.
Roy Marples [Fri, 27 Mar 2020 16:14:48 +0000 (16:14 +0000)]
dhcpcd: dumping lease uses control socket to get the lease
Thanks to privsep it's hard to know where the lease is now stored.
As such, the only true location is from the running dhcpcd process.
The ability to read a raw lease from stdin has been dropped.