]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
6 years agoFix typo in configure 7/head
Oleksandr Kravchuk [Tue, 25 Jun 2019 20:28:35 +0000 (22:28 +0200)] 
Fix typo in configure

6 years agoDHCP6: Fix INFORM support
Roy Marples [Thu, 20 Jun 2019 15:44:21 +0000 (16:44 +0100)] 
DHCP6: Fix INFORM support

6 years agoroute: Build list of static routes and routers correctly.
Roy Marples [Tue, 18 Jun 2019 16:35:23 +0000 (17:35 +0100)] 
route: Build list of static routes and routers correctly.

They they need to be inserted by rt_proto_add().

6 years agoRA: expire whole RA on carrier up
Roy Marples [Fri, 14 Jun 2019 16:05:24 +0000 (17:05 +0100)] 
RA: expire whole RA on carrier up

If preserving IP, we need to expire the whole RA now that we care
about RDNSS and DNSSL lifetimes. Cheat by setting the aquired time
to something very low so it all expires.

6 years agoarp: announce address from most preferred interface
Roy Marples [Fri, 14 Jun 2019 16:03:55 +0000 (17:03 +0100)] 
arp: announce address from most preferred interface

Now we no longer sort interfaces, this is needed.

6 years agoMerge branch 'master' into rbtree
Roy Marples [Fri, 14 Jun 2019 14:22:43 +0000 (15:22 +0100)] 
Merge branch 'master' into rbtree

6 years agodhcpcd: don't expire RA on carrier down when when preserving IP
Roy Marples [Fri, 14 Jun 2019 13:49:01 +0000 (14:49 +0100)] 
dhcpcd: don't expire RA on carrier down when when preserving IP

6 years agoRA: expire RDNSS and DNSSL entries
Roy Marples [Fri, 14 Jun 2019 12:53:51 +0000 (13:53 +0100)] 
RA: expire RDNSS and DNSSL entries

This allows us to remember N fully expired RA's which works around
an obscure issue where a received RA has no lifetime or any
prefixes with lifetimes but does have an instruction to start DHCP6.

It was harmless but filled the log with spam and now there is no
log spam!

6 years agoMerge pull request #6 from DanielG/master
Roy Marples [Wed, 12 Jun 2019 18:44:16 +0000 (19:44 +0100)] 
Merge pull request #6 from DanielG/master

30-hostname: Fix typo: hsort -> hshort

6 years ago30-hostname: Fix typo: hsort -> hshort 6/head
Daniel Gröber [Wed, 12 Jun 2019 17:59:53 +0000 (19:59 +0200)] 
30-hostname: Fix typo: hsort -> hshort

6 years agoDHCP6: Keep running regardless of RA state
Roy Marples [Wed, 12 Jun 2019 12:43:27 +0000 (13:43 +0100)] 
DHCP6: Keep running regardless of RA state

We should keep DHCP6 running even if routers expire or link changes.
This is noted in RFC3315 18.1.2:
   If the client receives no responses before the message transmission
   process terminates, as described in section 14, the client SHOULD
   continue to use any IP addresses, using the last known
   lifetimes for those addresses, and SHOULD continue to use any other
   previously obtained configuration parameters.

6 years agoFix a gcc warning about signed overflow
Roy Marples [Fri, 7 Jun 2019 16:15:00 +0000 (17:15 +0100)] 
Fix a gcc warning about signed overflow

6 years agoroute: Compile on older BSD platforms
Roy Marples [Fri, 7 Jun 2019 15:59:41 +0000 (16:59 +0100)] 
route: Compile on older BSD platforms

6 years agoroute: Use order from message / config
Roy Marples [Fri, 7 Jun 2019 15:37:00 +0000 (16:37 +0100)] 
route: Use order from message / config

We can't just make the order up as that is prone to error.
So apply ordering as from the source.

6 years agolinux: use correct prototype
Roy Marples [Sun, 5 May 2019 18:04:02 +0000 (19:04 +0100)] 
linux: use correct prototype

6 years agosun: Use sa_len rather than our variant.
Roy Marples [Sun, 5 May 2019 11:54:45 +0000 (11:54 +0000)] 
sun: Use sa_len rather than our variant.

6 years agosa: Fix compile on non BSD
Roy Marples [Sun, 5 May 2019 11:54:30 +0000 (11:54 +0000)] 
sa: Fix compile on non BSD

6 years agoroute: Fix OS route comparison
Roy Marples [Sun, 5 May 2019 11:47:54 +0000 (12:47 +0100)] 
route: Fix OS route comparison

This at least works on a multi-homed NetBSD.

6 years agosa: Ensure sa_addrtop has a buffer to write to
Roy Marples [Sun, 5 May 2019 11:46:32 +0000 (12:46 +0100)] 
sa: Ensure sa_addrtop has a buffer to write to

While here, if sa_family is AF_UNSPEC print a blank string.

6 years agosa: Add sa_len() to calculate sockaddr length for non BSD
Roy Marples [Sun, 5 May 2019 11:45:29 +0000 (12:45 +0100)] 
sa: Add sa_len() to calculate sockaddr length for non BSD

6 years agoroute: Fix stamping on existing kernel routes
Roy Marples [Sat, 4 May 2019 18:38:44 +0000 (19:38 +0100)] 
route: Fix stamping on existing kernel routes

6 years agoFix compile.
Roy Marples [Sat, 4 May 2019 10:07:18 +0000 (11:07 +0100)] 
Fix compile.

6 years agoMerge branch 'master' into rbtree
Roy Marples [Sat, 4 May 2019 10:05:17 +0000 (11:05 +0100)] 
Merge branch 'master' into rbtree

6 years agoMerge branch 'dhcpcd-7'
Roy Marples [Sat, 4 May 2019 09:54:00 +0000 (10:54 +0100)] 
Merge branch 'dhcpcd-7'

6 years agoDHCPv6: Fix exclude prefix length check.
Roy Marples [Sat, 4 May 2019 09:19:02 +0000 (10:19 +0100)] 
DHCPv6: Fix exclude prefix length check.

6 years agoRelease dhcpcd-7.2.2
Roy Marples [Sat, 4 May 2019 08:41:16 +0000 (09:41 +0100)] 
Release dhcpcd-7.2.2

6 years agosun: More validation around route messages
Roy Marples [Sat, 4 May 2019 08:17:01 +0000 (08:17 +0000)] 
sun: More validation around route messages

6 years agosun: Apply same RTM validation from BSD
Roy Marples [Fri, 3 May 2019 15:44:13 +0000 (15:44 +0000)] 
sun: Apply same RTM validation from BSD

6 years agoBSD: Ignore coverity errors
Roy Marples [Fri, 3 May 2019 15:27:35 +0000 (16:27 +0100)] 
BSD: Ignore coverity errors

We could do ((char *)rtm) + rtm->rtm_msglen but that looks
more ugly than rtm + 1.

6 years agoBSD: Validate RTM message lengths received
Roy Marples [Fri, 3 May 2019 14:44:51 +0000 (15:44 +0100)] 
BSD: Validate RTM message lengths received

Doubtful these lengths would be invalid, but you never know.

6 years agoBPF: Fix ARP BPF filter to actually filter unwanted ARP message types
Roy Marples [Fri, 3 May 2019 13:50:28 +0000 (14:50 +0100)] 
BPF: Fix ARP BPF filter to actually filter unwanted ARP message types

While here, clarify the BPF instruction space needed for ARP as it
could overflow in the very unlikely event we ARP for three
addresses at the same time.

6 years agoDHCPv6: Fix a potential read overflow with D6_OPTION_PD_EXCLUDE
Roy Marples [Fri, 3 May 2019 13:44:06 +0000 (14:44 +0100)] 
DHCPv6: Fix a potential read overflow with D6_OPTION_PD_EXCLUDE

dhcpcd only checks that the prefix length of the exclusion
matches the prefix length of the ia and equals the length of the
data in the option.
This could potentially overrun the in6_addr structure.

This is fixed by enforcing RFC 6603 section 4.2 option limits
more clearly.

Thanks to Maxime Villard <max@m00nbsd.net> for finding this.

6 years agoFix a small brain fart causing LINK_UNKNOWN to spin.
Roy Marples [Thu, 2 May 2019 20:48:52 +0000 (21:48 +0100)] 
Fix a small brain fart causing LINK_UNKNOWN to spin.

6 years agoBSD: Simplify carrier detection once more.
Roy Marples [Thu, 2 May 2019 20:25:57 +0000 (21:25 +0100)] 
BSD: Simplify carrier detection once more.

RTM_IFINFO messages now send the un-molested link status to
the main carrier handler which no longer polls on LINK_UNKNOWN.
Instead, we check carrier status directly, which if unsupported
we instead interface flags.

This is 2019, all interface drivers should report link status
correctly via RTM_IFINFO messages and trying to constantly work
around this is error prone and time consuming.

6 years agoFix comment
Roy Marples [Thu, 2 May 2019 12:06:44 +0000 (13:06 +0100)] 
Fix comment

6 years agoBSD: RTM_IFINFO is not emitted for all interfaces past unknown link
Roy Marples [Thu, 2 May 2019 12:02:36 +0000 (13:02 +0100)] 
BSD: RTM_IFINFO is not emitted for all interfaces past unknown link

It has to work for wireless interfaces, but we have no idea
about other interfaces. So test valid carrier for unknown.

6 years agoDon't report errno here.
Roy Marples [Mon, 29 Apr 2019 17:40:13 +0000 (18:40 +0100)] 
Don't report errno here.

6 years agodhcp: Cast away a warning on mips64
Roy Marples [Mon, 29 Apr 2019 16:36:21 +0000 (17:36 +0100)] 
dhcp: Cast away a warning on mips64

6 years agodhcp: Ensure that we have DHCP running on the receiving interface
Roy Marples [Mon, 29 Apr 2019 16:32:53 +0000 (17:32 +0100)] 
dhcp: Ensure that we have DHCP running on the receiving interface

... before trying to process the received BOOTP message on it.

6 years agoRelease dhcpcd-7.2.1
Roy Marples [Fri, 26 Apr 2019 13:32:54 +0000 (14:32 +0100)] 
Release dhcpcd-7.2.1

6 years agoMerge branch 'dhcpcd-7'
Roy Marples [Fri, 26 Apr 2019 13:20:24 +0000 (14:20 +0100)] 
Merge branch 'dhcpcd-7'

6 years agosun: Simplify initialisation of the multicast destination
Roy Marples [Fri, 26 Apr 2019 13:16:16 +0000 (13:16 +0000)] 
sun: Simplify initialisation of the multicast destination

6 years agoMerge branch 'dhcpcd-7'
Roy Marples [Fri, 26 Apr 2019 13:07:35 +0000 (14:07 +0100)] 
Merge branch 'dhcpcd-7'

6 years agoOpenBSD: Don't spam syslog when cannot send NA
Roy Marples [Fri, 26 Apr 2019 10:38:45 +0000 (11:38 +0100)] 
OpenBSD: Don't spam syslog when cannot send NA

The error is "No route to host".
OpenBSD does not support IPv6 address sharing, so it's no biggie.
As such, only log an error when debugging.

6 years agoFreeBSD: Fix fetching the IPv6 address lifetime
Roy Marples [Fri, 26 Apr 2019 10:27:25 +0000 (11:27 +0100)] 
FreeBSD: Fix fetching the IPv6 address lifetime

FreeBSD it seems sensibly uses a monotonic clock for IPv6 lifetimes
but the others use the wall clock.

6 years agoWhitespace
Roy Marples [Fri, 26 Apr 2019 00:17:29 +0000 (01:17 +0100)] 
Whitespace

6 years agosun: Don't define IN_IFF_TENTATIVE or IN_IFF_DETACHED
Roy Marples [Thu, 25 Apr 2019 12:04:45 +0000 (12:04 +0000)] 
sun: Don't define IN_IFF_TENTATIVE or IN_IFF_DETACHED

Let's not pretend these exist and adjust existing #ifdefs
to compensate.

6 years agosun: Detect correct broadcast address as RTM_NEWADDR lies
Roy Marples [Thu, 25 Apr 2019 12:02:50 +0000 (12:02 +0000)] 
sun: Detect correct broadcast address as RTM_NEWADDR lies

I suspect this is because the broadcast address needs to be set
after the address, but RTM_NEWADDR is triggered from adding the
address.

While here, actually set the broadcast address requested
for IPv4 and simplify the code.

6 years agodhcpcd.conf: Fix wording about ipv6rs
Roy Marples [Wed, 24 Apr 2019 14:21:41 +0000 (15:21 +0100)] 
dhcpcd.conf: Fix wording about ipv6rs

6 years agosun: Fix compile as IN6ADDR_LINKLOCAL_ALLNODES_INIT isn't defined.
Roy Marples [Wed, 24 Apr 2019 11:25:15 +0000 (11:25 +0000)] 
sun: Fix compile as IN6ADDR_LINKLOCAL_ALLNODES_INIT isn't defined.

6 years agoIPv6ND: Use generic initialisers rather than inet_pton
Roy Marples [Wed, 24 Apr 2019 11:18:25 +0000 (12:18 +0100)] 
IPv6ND: Use generic initialisers rather than inet_pton

6 years agosun: Fix adding IPv4LL default route
Roy Marples [Wed, 24 Apr 2019 11:00:57 +0000 (11:00 +0000)] 
sun: Fix adding IPv4LL default route

6 years agosun: Bind IPv6ND socket to interface.
Roy Marples [Tue, 23 Apr 2019 18:54:39 +0000 (18:54 +0000)] 
sun: Bind IPv6ND socket to interface.

Just to be on the safe side as it is per interface ....

6 years agoFix compile
Roy Marples [Tue, 23 Apr 2019 18:53:59 +0000 (19:53 +0100)] 
Fix compile

6 years agoFix compile for non-sun
Roy Marples [Tue, 23 Apr 2019 17:34:27 +0000 (18:34 +0100)] 
Fix compile for non-sun

6 years agosun: Open an IPv6ND socket per interface
Roy Marples [Tue, 23 Apr 2019 17:27:52 +0000 (17:27 +0000)] 
sun: Open an IPv6ND socket per interface

This is needed because we need to join the all-nodes multi-cast
group and that only works per interface.

6 years agosun: Making routing work with both 64-bit and 32-bit userlands
Roy Marples [Mon, 22 Apr 2019 12:37:15 +0000 (12:37 +0000)] 
sun: Making routing work with both 64-bit and 32-bit userlands

Basically Dilos is 64-bit userland and SmartOS is 32-bit.
We need code to fit both, this seems to work.

6 years agosun: Fix numerous issues handling route messages
Roy Marples [Sun, 21 Apr 2019 23:56:48 +0000 (23:56 +0000)] 
sun: Fix numerous issues handling route messages

Fix extracting the sockaddr's.
Fix finding the correct alias for new addresses.
Fix finding the correct alias for deleted addresses.
Fix finding the correct flags for the alias.

6 years agosun: Read RTA_IFA for IPv6 routes.
Roy Marples [Sun, 21 Apr 2019 20:17:49 +0000 (20:17 +0000)] 
sun: Read RTA_IFA for IPv6 routes.

As a side note, I find it very odd that the kernel can return
RTA_IFA but ignores it when adding or changing routes!

6 years agosun: Set RTA_IFP and RTA_IFA again for default routes
Roy Marples [Sun, 21 Apr 2019 20:14:42 +0000 (20:14 +0000)] 
sun: Set RTA_IFP and RTA_IFA again for default routes

Note that RTA_IFA doesn't actually work with the kernel
and RTA_SRC doesn't work with RTF_GATEWAY which is more
important.

6 years agosun: Continue walking dlpi links when dlpi_open returns no link
Roy Marples [Sat, 20 Apr 2019 21:11:05 +0000 (00:11 +0300)] 
sun: Continue walking dlpi links when dlpi_open returns no link

The link could have just vanished, or it's in a zone.
As such, continue.

6 years agoauth: Improve comment about DHCPv4 option splitting not working
Roy Marples [Sat, 20 Apr 2019 20:07:16 +0000 (21:07 +0100)] 
auth: Improve comment about DHCPv4 option splitting not working

Patches to fix this welcome :)

6 years agoDHCPv6: fix warning message wording
Roy Marples [Sat, 20 Apr 2019 20:03:21 +0000 (21:03 +0100)] 
DHCPv6: fix warning message wording

6 years agoMerge branch 'dhcpcd-7'
Roy Marples [Fri, 19 Apr 2019 20:54:19 +0000 (21:54 +0100)] 
Merge branch 'dhcpcd-7'

6 years agoReally add consttime_memequal
Roy Marples [Fri, 19 Apr 2019 20:47:37 +0000 (21:47 +0100)] 
Really add consttime_memequal

6 years agocompat: Provide consttime_memequal if not in libc
Roy Marples [Fri, 19 Apr 2019 20:42:07 +0000 (21:42 +0100)] 
compat: Provide consttime_memequal if not in libc

Public domain version by Matthias Drochner <drochner@netbsd.org>

6 years agoauth: Use consttime_memequal(3) to compare hashes
Roy Marples [Fri, 19 Apr 2019 20:40:14 +0000 (21:40 +0100)] 
auth: Use consttime_memequal(3) to compare hashes

This stops any attacker from trying to infer secrets from latency.

Thanks to Maxime Villard <max@m00nbsd.net>

6 years agoDHCP: Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED
Roy Marples [Fri, 19 Apr 2019 20:00:19 +0000 (21:00 +0100)] 
DHCP: Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED

This fix basically moves the option length check up and also
corrects an off by one error with it.

Thanks to Maxime Villard <max@m00nbsd.net>

6 years agoDHCPv6: Fix a potential buffer overflow reading NA/TA addresses
Roy Marples [Fri, 19 Apr 2019 08:45:02 +0000 (09:45 +0100)] 
DHCPv6: Fix a potential buffer overflow reading NA/TA addresses

Only copy upto the size of the address option rather than the
option length.

Found by Maxime Villard <max@m00nbsd.net>

6 years agoLinux: Fix compile
Roy Marples [Fri, 19 Apr 2019 08:07:13 +0000 (09:07 +0100)] 
Linux: Fix compile

6 years agoBPF: Set BPF_MCAST flag as on BSD
Roy Marples [Thu, 18 Apr 2019 17:05:56 +0000 (18:05 +0100)] 
BPF: Set BPF_MCAST flag as on BSD

6 years agoARP: Ignore Unicast Poll messages, RFC1122.
Roy Marples [Thu, 18 Apr 2019 16:01:10 +0000 (17:01 +0100)] 
ARP: Ignore Unicast Poll messages, RFC1122.

6 years agoBPF: Set flag indicate whether the packet was broadcast or not
Roy Marples [Thu, 18 Apr 2019 15:56:34 +0000 (16:56 +0100)] 
BPF: Set flag indicate whether the packet was broadcast or not

6 years agoARP: Refactor so that ACD is available for all inet addresses
Roy Marples [Thu, 18 Apr 2019 13:54:47 +0000 (14:54 +0100)] 
ARP: Refactor so that ACD is available for all inet addresses

Callbacks have also been improved so they are more descriptive.

6 years agoChanged mind, use .0
Roy Marples [Thu, 18 Apr 2019 13:54:29 +0000 (14:54 +0100)] 
Changed mind, use .0

6 years agodhcpcd is now 7.99.1
Roy Marples [Thu, 18 Apr 2019 12:01:06 +0000 (13:01 +0100)] 
dhcpcd is now 7.99.1

6 years agoRelease dhcpcd-7.2.0
Roy Marples [Wed, 17 Apr 2019 22:42:45 +0000 (23:42 +0100)] 
Release dhcpcd-7.2.0

6 years agoLinux: Fix compile
Roy Marples [Wed, 17 Apr 2019 22:18:39 +0000 (22:18 +0000)] 
Linux: Fix compile

6 years agoFreeBSD: fix compile
Roy Marples [Wed, 17 Apr 2019 21:59:47 +0000 (22:59 +0100)] 
FreeBSD: fix compile

6 years agoForgot these from merge
Roy Marples [Wed, 17 Apr 2019 08:17:07 +0000 (08:17 +0000)] 
Forgot these from merge

6 years agoMerge branch 'master' into rbtree
Roy Marples [Wed, 17 Apr 2019 08:15:30 +0000 (08:15 +0000)] 
Merge branch 'master' into rbtree

6 years agoroute: Don't install an IPv4LL default route if static one exists
Roy Marples [Wed, 17 Apr 2019 01:14:00 +0000 (01:14 +0000)] 
route: Don't install an IPv4LL default route if static one exists

6 years agoFix compile
Roy Marples [Tue, 16 Apr 2019 21:45:13 +0000 (22:45 +0100)] 
Fix compile

6 years agosun: Add rbtree support
Roy Marples [Tue, 16 Apr 2019 21:41:47 +0000 (21:41 +0000)] 
sun: Add rbtree support

6 years agoMerge branch 'master' into rbtree
Roy Marples [Tue, 16 Apr 2019 19:02:36 +0000 (20:02 +0100)] 
Merge branch 'master' into rbtree

6 years agoRevert "route: Disable RT_FREE_ROUTE_TABLE by default."
Roy Marples [Tue, 16 Apr 2019 18:48:46 +0000 (19:48 +0100)] 
Revert "route: Disable RT_FREE_ROUTE_TABLE by default."

This reverts commit 46059a78ef33341de80c0085570f71bf0ec15e8b.

6 years agosun: Don't read beyond the sockaddr length when making RTM
Roy Marples [Tue, 16 Apr 2019 18:13:25 +0000 (18:13 +0000)] 
sun: Don't read beyond the sockaddr length when making RTM

6 years agoif: Add a generic function to create an aliased address name
Roy Marples [Tue, 16 Apr 2019 18:12:16 +0000 (18:12 +0000)] 
if: Add a generic function to create an aliased address name

Reduces complexity between IPv4 and IPv6 and silences a warning
about potential string trunctaion if the LUN makes too big an
interface name.

6 years agoduid: If no UUID support, don't warn about unused variable.
Roy Marples [Tue, 16 Apr 2019 18:09:50 +0000 (18:09 +0000)] 
duid: If no UUID support, don't warn about unused variable.

6 years agoBSD: Simplify rtm usage
Roy Marples [Mon, 15 Apr 2019 11:39:07 +0000 (12:39 +0100)] 
BSD: Simplify rtm usage

6 years agosun: Find the interface in if_finishrt
Roy Marples [Mon, 15 Apr 2019 11:30:14 +0000 (14:30 +0300)] 
sun: Find the interface in if_finishrt

Makes the code a bit smaller.

6 years agosun: Update the interface index after plumbing
Roy Marples [Sun, 14 Apr 2019 11:01:21 +0000 (14:01 +0300)] 
sun: Update the interface index after plumbing

Otherwise it's likely zero ....

6 years agosun: Use lo0 if we can't find an interface for our route
Roy Marples [Sun, 14 Apr 2019 10:48:29 +0000 (13:48 +0300)] 
sun: Use lo0 if we can't find an interface for our route

We need to operate on the route, and dhcpcd needs an interface for
each route. This seems to work for now.

6 years agosun: Fix carrier detection, MTU detection and plumbing
Roy Marples [Sun, 14 Apr 2019 09:54:16 +0000 (12:54 +0300)] 
sun: Fix carrier detection, MTU detection and plumbing

dhcpcd no longer needs ifconfig to do the initial plumbing.

6 years agosun: Don't report error if interface does not exist during preinit
Roy Marples [Sun, 14 Apr 2019 09:53:25 +0000 (12:53 +0300)] 
sun: Don't report error if interface does not exist during preinit

For sun this is normal as we only create the initial interface
when adding an address.

6 years agosun: Fix routing issues
Roy Marples [Sat, 13 Apr 2019 15:40:39 +0000 (18:40 +0300)] 
sun: Fix routing issues

Solaris doesn't seem to have interface sets for some routes.
Call RTM_GET for these to discover the outbound interface.

Fix adding default routes.

6 years agosun: Compile once more
Joerg Sonnenberger [Fri, 12 Apr 2019 14:25:06 +0000 (15:25 +0100)] 
sun: Compile once more

6 years agooptions: improve string parsing some more
Roy Marples [Thu, 11 Apr 2019 16:18:29 +0000 (17:18 +0100)] 
options: improve string parsing some more

6 years agooptions: terminate strings that are not quoted
Roy Marples [Wed, 10 Apr 2019 21:58:36 +0000 (22:58 +0100)] 
options: terminate strings that are not quoted

6 years agoDHCP: abort BPF in test mode on receipt of message.
Roy Marples [Wed, 10 Apr 2019 21:33:01 +0000 (22:33 +0100)] 
DHCP: abort BPF in test mode on receipt of message.