Roy Marples [Wed, 6 Feb 2019 19:39:00 +0000 (19:39 +0000)]
gcc: appease gcc-7's implicit fallthrough warning
We now need to define __fallthrough for one part because
cpp strips comments from preprocessed code and I don't want to
enforce needing -C in CFLAGS to avoid this.
Roy Marples [Sat, 26 Jan 2019 00:08:43 +0000 (00:08 +0000)]
BSD: treat LINK_STATE_UNKNOWN as DOWN if media is invalid
On BSD, some interfaces might emit RTM_IFINFO before the link state
has initialised. Mainly wireless cards.
If the intial carrier call says media state change is valid,
we need to treat LINK_STATE_UNKNOWN as LINK_DOWN rather than
LINK_UP.
Roy Marples [Mon, 14 Jan 2019 12:57:37 +0000 (12:57 +0000)]
BSD: Fix UP/DOWN for interfaces which dont' report media changes
Carrier UP/DOWN state is handled by media change events on BSD.
When the carrier state changes, it's always to LINK_STATE_DOWN or
LINK_STATE_UP.
If we receive LINK_STATE_UNKNOWN from RTM_IFINFO it means the
interface doesn't change media change events and as such won't
report carrier state changes. In this instance, we can only rely
on IFF_UP being set, which is the same condition dhcpcd needs
for LINK_STATE_UP.
Roy Marples [Sat, 5 Jan 2019 11:42:12 +0000 (11:42 +0000)]
ip6: Implement IPv6 address sharing
This allows the same IPv6 address to exist on more than one
interface. Whenever dhcpcd address an IPv6 address, it will
advertise it along with the hardware address of the preferred
interface.
This is heavliy reliant on the kernel supporting this as it's the
kernel that handle the Duplicate Address Detection.
In a nutshell it needs to support RFC 7527 and ignore NA packets
from any hardware address the host owns.
Currently the only known kernel that fully supports this is
NetBSD-8.99.27
Roy Marples [Fri, 30 Nov 2018 03:50:23 +0000 (03:50 +0000)]
BSD: Always set RTA_IFP for routes
Unless we are OpenBSD adding INET6 routes without a gateway.
this should work, but doesn't.
No biggie as no OS currently supports sharing IPv6 addresses on
more than one interface.
Roy Marples [Wed, 7 Nov 2018 18:57:20 +0000 (18:57 +0000)]
BSD: Use SO_RERROR on the route(4) socket.
This allows NetBSD to receive ENOBUFS again so it can detect
route(4) overflow.
This was recently defaulted to off globably, but is now settable
per socket.
dhcpcd.conf.5.in: Fix various typos, add more markup, etc.
Fix some minor spelling and grammar issues, add more markup in places to help contextualize terms, add a touch more detail to 'Defining new options', make acronym formatting more consistent, etc.
Use a consistent format for RFC references: a space between RFC and the ID number, as this is the most commonly-used format in man pages, and indeed in the RFCs themselves. Also, a few minor grammatical fixes.
Roy Marples [Sat, 2 Jun 2018 09:27:45 +0000 (10:27 +0100)]
ip6: if forked from ia callback, don't run ia handlers
It's pointless and resolves an issue where the handler would try
and listen to an address when not in master mode, but it's already
listened to in the child.
Roy Marples [Tue, 8 May 2018 11:27:42 +0000 (12:27 +0100)]
dhcp6: match IA type with request
So we don't send IA_NA, IA_TA and IA_PD addresses in the
IA_NA request if they all share the same IAID.
While here, fix a bug where IA_TA addresses would append
the DHCP6 unknown option 0 by mistakenly trying to put T1
and T2 timers in where there should be none.
Roy Marples [Mon, 7 May 2018 20:20:26 +0000 (21:20 +0100)]
dhcp6: IAID is now unique for IA type
RFC3315 is a bit ambigious about this. At the start it says that
IAID is supposed to be unique across the client, but futher down
it starts to mention that the IAID number space is unqiuie to the
IA type.
RFC3315bis clarifies it's unique for the client and IA type, so
you can now have ia_na 1 and ia_pd 1.
Roy Marples [Sun, 29 Apr 2018 20:38:58 +0000 (21:38 +0100)]
auth: allow different tokens for send and receive
It was silly of me to assume that the same key would be used for
both sending and receiving. Because token protocol is not digested,
replace the digest argument with 0x123/0x456 where 0x123 is the
sending key and 0x456 is the receiving key.
Receiving key defaults to sending key, sending key defaults to zero.
This should allow existing configurations to work as is.
Roy Marples [Sun, 29 Apr 2018 20:28:15 +0000 (21:28 +0100)]
auth: allow zero value replay detection data
It seems one ISP doesn't use Replay Data and always sets it to zero.
See the comment in the commit as to why this is technically legal,
even if it goes against the intent of the RFC.
Roy Marples [Thu, 26 Apr 2018 18:35:43 +0000 (19:35 +0100)]
RFC 3315 21.4.4.1 says that SOLICT and DELAYED authentication
should set RDM and replay data to zero.
draft-ietf-dhc-dhcpv6-clarify-auth-01 (expired) suggests that
INFORMATION REQ should be zero in this case as well.
As it's coming from a very similar angle, I agree.