]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
3 weeks agoDHCP: Request static_routes from dhcpcd.conf master 397/head
Roy Marples [Mon, 16 Jun 2025 22:54:31 +0000 (23:54 +0100)] 
DHCP: Request static_routes from dhcpcd.conf

Rather than being requested by default in the dhcpcd binary.
This matches classless_static_routes.

3 weeks agoDHCP: Don't request a lease time
Roy Marples [Mon, 16 Jun 2025 22:45:17 +0000 (23:45 +0100)] 
DHCP: Don't request a lease time

RFC 2131 4.3.1 says lease time MUST be included in OFFER and ACK
so there is no need to request it.

3 weeks agoAdd truncate to defintions
Roy Marples [Thu, 12 Jun 2025 10:43:48 +0000 (11:43 +0100)] 
Add truncate to defintions

This indicates an option might be truncated from it's natural
length and will be zero padded on expansion.
Only supported for the ip6address option.

While here, support 1 as a bitflag to just print the bit.

Fixes #508.

3 weeks agoDHCP: Don't request T1 and T2
Roy Marples [Sun, 15 Jun 2025 21:23:13 +0000 (22:23 +0100)] 
DHCP: Don't request T1 and T2

RFC2131 4.4.5 says:
The server SHOULD return T1 and T2.

Other DHCP clients don't request them by default and we can save two
bytes in the message size by not sending them.

5 weeks agoRelease dhcpcd-10.2.4 v10.2.4
Roy Marples [Sun, 1 Jun 2025 18:40:28 +0000 (19:40 +0100)] 
Release dhcpcd-10.2.4

5 weeks agocompat: use timingsafe_bcmp if available
Roy Marples [Sun, 1 Jun 2025 15:52:28 +0000 (16:52 +0100)] 
compat: use timingsafe_bcmp if available

Its return value is the opposite of consttime_memequal.
This function is available all modern BSD's except for NetBSD where
we have consttime_memequal.

6 weeks agoIPv6ND: Sort routers by reachability correctly.
Roy Marples [Tue, 20 May 2025 23:54:58 +0000 (00:54 +0100)] 
IPv6ND: Sort routers by reachability correctly.

Related to #492.

6 weeks agodefintions: define ND Route Information option
Roy Marples [Tue, 20 May 2025 22:59:31 +0000 (23:59 +0100)] 
defintions: define ND Route Information option

We can't express a 2-bit integer at a 3 bit offset yet
so just print the reserved value.

Also allows this option to be excluded, fixing #506.

6 weeks agoIPv6: Clear previous address RA flags on receipt of a RA.
Roy Marples [Tue, 20 May 2025 21:10:41 +0000 (22:10 +0100)] 
IPv6: Clear previous address RA flags on receipt of a RA.

This allows a prefix gateway to transition from onlink to
not on link.

Fixes #506.

6 weeks agoroute: return false for rt_add on failure rather than garbage
Roy Marples [Tue, 20 May 2025 19:27:49 +0000 (20:27 +0100)] 
route: return false for rt_add on failure rather than garbage

7 weeks agoRelease dhcpcd-10.2.3 v10.2.3
Roy Marples [Fri, 16 May 2025 12:30:35 +0000 (13:30 +0100)] 
Release dhcpcd-10.2.3

7 weeks agoFix prior for FreeBSD and OpenBSD
Roy Marples [Fri, 16 May 2025 12:19:31 +0000 (13:19 +0100)] 
Fix prior for FreeBSD and OpenBSD

7 weeks agoIPv6: store the destination address
Roy Marples [Fri, 16 May 2025 12:12:22 +0000 (13:12 +0100)] 
IPv6: store the destination address

We need to match this address on BSD and Illumos as it might be
the gateway address for a route to find the interface it belongs to.

8 weeks agoFix a cast warning on DragonflyBSD
Roy Marples [Fri, 9 May 2025 11:56:33 +0000 (12:56 +0100)] 
Fix a cast warning on DragonflyBSD

8 weeks agoBump for prior.
Roy Marples [Thu, 8 May 2025 16:29:10 +0000 (17:29 +0100)] 
Bump for prior.

8 weeks agodhcpcd: fork to background on initial timeout
Roy Marples [Thu, 8 May 2025 16:26:52 +0000 (17:26 +0100)] 
dhcpcd: fork to background on initial timeout

Unless the -1, --oneshot option is given.
dhcpcd should keep on trying to configure the interface.
Fixes #423

8 weeks agodhcpcd: Fix -b --background
Roy Marples [Thu, 8 May 2025 15:49:44 +0000 (16:49 +0100)] 
dhcpcd: Fix -b --background

It's been broken for a while... just the 11 years ago in 1d5d236
Initial fix for #423

2 months agolinux: stop old interface name instead of new one (#505)
Quang Anh [Sat, 26 Apr 2025 17:15:35 +0000 (00:15 +0700)] 
linux: stop old interface name instead of new one (#505)

2 months agoRestore logic on when to open an address specific socket (#502)
Doug Nazar [Fri, 25 Apr 2025 19:37:54 +0000 (15:37 -0400)] 
Restore logic on when to open an address specific socket (#502)

850f93b changed the logic while moving things around. Restore
the original logic so we open a socket even if the address is the
same, so long as it's the first time.

2 months agocast pid_t to int when used in format strings
Roy Marples [Tue, 15 Apr 2025 13:28:10 +0000 (14:28 +0100)] 
cast pid_t to int when used in format strings

Silences warnings on Solaris

2 months agosun: fix compile for if_mtu
Roy Marples [Tue, 15 Apr 2025 13:16:46 +0000 (14:16 +0100)] 
sun: fix compile for if_mtu

2 months agoduid: document we don't create a duid from system uuid by default
Roy Marples [Tue, 15 Apr 2025 10:46:35 +0000 (11:46 +0100)] 
duid: document we don't create a duid from system uuid by default

Fixes #496

2 months agoresolv: Fix processing more DNSSL options than RDNSS
Roy Marples [Tue, 15 Apr 2025 10:03:37 +0000 (11:03 +0100)] 
resolv: Fix processing more DNSSL options than RDNSS

2 months agodhcpcd: Remove option rapid_commit from dhcpcd.conf
Roy Marples [Tue, 15 Apr 2025 09:45:19 +0000 (10:45 +0100)] 
dhcpcd: Remove option rapid_commit from dhcpcd.conf

Apparently some ISPs report they support it by sending the option
back, but the reality is they don't.

Fixes #499.

2 months agoprivsep: Fix valgrind and hardened-malloc on Linux with SECCOMP
Roy Marples [Tue, 15 Apr 2025 09:29:11 +0000 (10:29 +0100)] 
privsep: Fix valgrind and hardened-malloc on Linux with SECCOMP

Valgrind will still error by default at exit as the syscall to
unlink the pipe files is denied.
This can be avoided by compiling with -DVALGRIND.
The pipe files still won't be removed as dhcpcd has
already dropped to the non root user.
This is a Vagrind issue really.

hardened-malloc should now run as well as their documented syscalls
are now allowed by default.

Fixes #497.

3 months agoroute: Don't spam route changes for lifetime
Roy Marples [Fri, 28 Mar 2025 19:44:48 +0000 (19:44 +0000)] 
route: Don't spam route changes for lifetime

Fixes #459

3 months agodhcpcd: ignore ENXIO on handlelink
Roy Marples [Tue, 1 Apr 2025 09:03:42 +0000 (10:03 +0100)] 
dhcpcd: ignore ENXIO on handlelink

3 months agoLinux: Fix build for kernels without RTA_EXPIRES
Roy Marples [Wed, 26 Mar 2025 10:20:45 +0000 (10:20 +0000)] 
Linux: Fix build for kernels without RTA_EXPIRES

Fixes #493.

3 months agoDHCP6: Don't reboot when not doing DHCPv6
Roy Marples [Tue, 11 Mar 2025 12:02:41 +0000 (12:02 +0000)] 
DHCP6: Don't reboot when not doing DHCPv6

For #437 and #478.

3 months agoBPF: Start with the EOF marker set
Roy Marples [Sun, 9 Mar 2025 19:56:40 +0000 (19:56 +0000)] 
BPF: Start with the EOF marker set

This will allow us to abort any BPF read loop if it's reset.
While here, delay restarting DHCP slightly to allow privsep builds
to recover the same error.

Fixes #481.

3 months agoBSD: Fix compile on some BSD OS mtu
Roy Marples [Sun, 9 Mar 2025 16:11:38 +0000 (16:11 +0000)] 
BSD: Fix compile on some BSD OS

if_mtu is a macro in these headers which conflicts with our function

4 months agoRelease dhcpcd-10.2.2 v10.2.2
Roy Marples [Tue, 25 Feb 2025 12:37:57 +0000 (12:37 +0000)] 
Release dhcpcd-10.2.2

4 months agorelease: Default to gpg2 to avoid SHA1 signatures
Roy Marples [Tue, 25 Feb 2025 11:54:01 +0000 (11:54 +0000)] 
release: Default to gpg2 to avoid SHA1 signatures

Fixes #457

4 months agooptions: Allow interface block to be pattern matching
Roy Marples [Mon, 24 Feb 2025 16:31:23 +0000 (16:31 +0000)] 
options: Allow interface block to be pattern matching

Fixes #473

4 months agoDHCP6: Fix dhcpcd vendor class option
Roy Marples [Fri, 21 Feb 2025 22:48:42 +0000 (22:48 +0000)] 
DHCP6: Fix dhcpcd vendor class option

4 months agoRelease dhcpcd-10.2.1 v10.2.1
Roy Marples [Sun, 23 Feb 2025 20:38:43 +0000 (20:38 +0000)] 
Release dhcpcd-10.2.1

4 months agoWelcome to 2025.
Roy Marples [Sun, 23 Feb 2025 20:37:52 +0000 (20:37 +0000)] 
Welcome to 2025.

4 months agoAdd nosyslog
Roy Marples [Sun, 23 Feb 2025 20:23:45 +0000 (20:23 +0000)] 
Add nosyslog

Fixes #472.

4 months agoRemove accidently added debug
Roy Marples [Sun, 23 Feb 2025 16:37:41 +0000 (16:37 +0000)] 
Remove accidently added debug

4 months agoOnly drop IPv4 LL addresses if configured to handle them (#464)
Colin McInnes [Sat, 22 Feb 2025 13:37:59 +0000 (07:37 -0600)] 
Only drop IPv4 LL addresses if configured to handle them (#464)

4 months agoroute lifetime behaviour should mirror other lifetimes
Roy Marples [Sat, 22 Feb 2025 13:21:17 +0000 (13:21 +0000)] 
route lifetime behaviour should mirror other lifetimes

Each lifetime has a an aquistion time so we can compare to
now to know how much of the lifetime is left.
Apply the difference when adding/changing the route just as we
do for addresses.

This allow us to work out better when we need to update the
route lifetime from a newer aquisition.

Fixes #465.

4 months agoDHCP6: RENEW/REBIND if T1/T2 have passed at CONFIRM
Roy Marples [Fri, 21 Feb 2025 09:47:25 +0000 (09:47 +0000)] 
DHCP6: RENEW/REBIND if T1/T2 have passed at CONFIRM

4 months agoBSD: Loop when pulling routes into our buffer if no memory
Roy Marples [Thu, 20 Feb 2025 13:41:34 +0000 (13:41 +0000)] 
BSD: Loop when pulling routes into our buffer if no memory

We need to make two sysctls to pull the route table from the kernel.
The first one works out the size of the buffer required and the
second one populates it.
It's possible for more routes to be added between these two calls
causing the second call to fail with ENOMEM.
If this happens, just re-query the size needed and try again.

Fixes #466.

4 months agoOpenBSD: fetching MTU works with privsep again
Roy Marples [Wed, 19 Feb 2025 17:49:20 +0000 (17:49 +0000)] 
OpenBSD: fetching MTU works with privsep again

4 months agoBSD: Fix netmask family and length for incoming route msgs
Roy Marples [Tue, 18 Feb 2025 09:48:19 +0000 (09:48 +0000)] 
BSD: Fix netmask family and length for incoming route msgs

Netmask family and length are ignored by traditional
userland tools such as route and netstat and are assumed
to match the destination sockaddr.
This is fortunate because BSD kernels use a radix tree
to store routes which adjusts the netmask at the point
of insertion where this information is lost.
We can just sub in the values from the destination address.

This is currently true for all BSD kernels.

4 months agoFor route MTU comparison allow zero MTU to match interface MTU
Roy Marples [Mon, 17 Feb 2025 15:01:45 +0000 (15:01 +0000)] 
For route MTU comparison allow zero MTU to match interface MTU

Because some OS put the interface MTU into the route MTU if the
route does not define its own.

4 months agodhcpcd: Don't leak an interface on link overflow
Roy Marples [Mon, 17 Feb 2025 14:18:11 +0000 (14:18 +0000)] 
dhcpcd: Don't leak an interface on link overflow

4 months agoFix building with different options
Roy Marples [Thu, 13 Feb 2025 11:05:10 +0000 (11:05 +0000)] 
Fix building with different options

Fixes #458.

Add many build options to the NetBSD target
Set any warnings to be errors as NetBSD should build without
any warnings. DragonFly as well, but we don't have a target for that.

4 months agoRefuse to import-src without being configured
Roy Marples [Wed, 12 Feb 2025 18:48:35 +0000 (18:48 +0000)] 
Refuse to import-src without being configured

4 months agoRelease dhcpcd-10.2.0 v10.2.0
Roy Marples [Wed, 12 Feb 2025 15:31:36 +0000 (15:31 +0000)] 
Release dhcpcd-10.2.0

4 months agoUpdate build.yml to fix BSD builds (#456)
Martin-Éric RACINE [Wed, 12 Feb 2025 15:39:27 +0000 (17:39 +0200)] 
Update build.yml to fix BSD builds (#456)

4 months agoIncrease max IPv4 clientid. (#442)
Gilad Naaman [Wed, 12 Feb 2025 15:29:39 +0000 (17:29 +0200)] 
Increase max IPv4 clientid. (#442)

Remove arbitrary limit, raising to the maximum representable by uint8

Co-authored-by: Roy Marples <roy@marples.name>
4 months agoDHCP6: Apply SOL and INF MAX_RT to REPLY messages too.
Jon Franklin [Wed, 12 Feb 2025 15:05:33 +0000 (15:05 +0000)] 
DHCP6: Apply SOL and INF MAX_RT to REPLY messages too.

4 months agoDHCP6: Implement USE_MULTICAST
Jon Franklin [Wed, 12 Feb 2025 12:46:50 +0000 (12:46 +0000)] 
DHCP6: Implement USE_MULTICAST

4 months agoDHCP6: Align MAX_RC values with RFC 8415
Jon Franklin [Wed, 12 Feb 2025 12:45:17 +0000 (12:45 +0000)] 
DHCP6: Align MAX_RC values with RFC 8415

4 months agoDHCP: Align the BPF buffer to sizeof(struct ip *)
Roy Marples [Wed, 12 Feb 2025 12:02:53 +0000 (12:02 +0000)] 
DHCP: Align the BPF buffer to sizeof(struct ip *)

This is for non privsep only and should fix Sparc64.
Fixes #430.

4 months agoDHCP: Fix crash when someone deletes our address
Roy Marples [Wed, 5 Feb 2025 18:06:01 +0000 (18:06 +0000)] 
DHCP: Fix crash when someone deletes our address

Fixes #455

4 months agoDHCP: Remove a compile warning
Roy Marples [Wed, 12 Feb 2025 11:24:07 +0000 (11:24 +0000)] 
DHCP: Remove a compile warning

4 months agoillumos: always mark routes as static
Roy Marples [Wed, 12 Feb 2025 10:51:26 +0000 (10:51 +0000)] 
illumos: always mark routes as static

Otherwise in.routed will delete the default route on OmniOS!

4 months agollumos: detect closefrom(3c)
Roy Marples [Wed, 12 Feb 2025 09:53:25 +0000 (09:53 +0000)] 
llumos: detect closefrom(3c)

4 months agoDHCP: when ifa sees the bound address, always add it to state
Roy Marples [Wed, 16 Oct 2024 09:04:57 +0000 (10:04 +0100)] 
DHCP: when ifa sees the bound address, always add it to state

This should fix dhcpcd sending the correct DHCP message type
when entering the RENEW or REBIND state.

Fixes #355.

Co-authored-by: Zikai Chen <chenzikai@google.com>
4 months agoIPv6: Abort ND when roaming
Roy Marples [Fri, 7 Feb 2025 12:08:31 +0000 (12:08 +0000)] 
IPv6: Abort ND when roaming

4 months agoDHCP6: Fix --rebind on the control socket to really rebind
Roy Marples [Fri, 7 Feb 2025 12:04:43 +0000 (12:04 +0000)] 
DHCP6: Fix --rebind on the control socket to really rebind

Rather than start a REBIND and then change straight to CONFIRM.
Fixes #437.

4 months agoBSD: Improve NEWADDR == IFF_UP handling
Roy Marples [Fri, 7 Feb 2025 11:47:01 +0000 (11:47 +0000)] 
BSD: Improve NEWADDR == IFF_UP handling

On BSD when an address is added, the interface is automatically
brought up.
We can detect this by RTM_NEWADDR, but that lacks the IFF_UP flag.
We really want to stay in sync with RTM messages for flags, but
here we need to check the interface for IFF_UP if we think it's
not there. Only set that.

This fixes NEWADDR announcements for state transitions when
the interface is currently down.

5 months agoAlways send req for InfoRefreshTime option on Inform-Req (#446)
Colin McInnes [Wed, 5 Feb 2025 19:38:55 +0000 (13:38 -0600)] 
Always send req for InfoRefreshTime option on Inform-Req (#446)

RFC8415 says client must always request Information Request refresh time
option 32.
Client has other logic for handling if server does not include this in
the reply.

Resolves #445.

5 months agoDHCP: shrink code a little
Roy Marples [Wed, 5 Feb 2025 18:04:00 +0000 (18:04 +0000)] 
DHCP: shrink code a little

5 months agoprivsep: ASAN now works
Roy Marples [Wed, 5 Feb 2025 18:01:34 +0000 (18:01 +0000)] 
privsep: ASAN now works

On Linux at least, Fedora-41 tested.
`./configure --sanitize` sets it all up.

5 months agoUpdate route if lifetime needs changing (#441)
Colin McInnes [Wed, 5 Feb 2025 14:06:10 +0000 (08:06 -0600)] 
Update route if lifetime needs changing (#441)

Everything about IPv6 is lifetime, not expiry.
Only linux routes have an expiry.

OK, this is not consistent at all!
In the kernel RTA_EXPIRES is only set for IPv4 multicast routes
when emitting route changes and only read for IPv6 routes when
userland makes route changes.
We cannot set this for non IPv6 routes currently.

To make it worse, we set a UINT32 for IPv6 routes but read a
UINT64 for IPv4 multicast routes.

To make this even more totally bonkers, the expiry we set for
the IPv6 route can be read back via RTA_CACHEINE rta_expires
but we need to convert to divide it by hz.

Now we can read kernel route lifetime correctly, we can compare this to what we think it should be when building the routing table (allowing for some deviation due to processing time) and update if needed.

Fixes #428.

5 months agoprivsep: Exit cleanly when built for address sanitization on Linux
Roy Marples [Wed, 5 Feb 2025 13:35:49 +0000 (13:35 +0000)] 
privsep: Exit cleanly when built for address sanitization on Linux

5 months agoFix using multiple enterprise IDs with vendclass (Option 124 DHCP / Option 16 DHCPv6)
Stipe [Sat, 18 Jan 2025 11:46:20 +0000 (12:46 +0100)] 
Fix using multiple enterprise IDs with vendclass (Option 124 DHCP / Option 16 DHCPv6)

Fixes #328

5 months agoIPv6: Use lifetime_left function to reduce code size
Roy Marples [Wed, 15 Jan 2025 20:30:24 +0000 (20:30 +0000)] 
IPv6: Use lifetime_left function to reduce code size

No functional change intended.

5 months agoBSD: FreeBSD allows RTA_IFP correctly.
Roy Marples [Wed, 15 Jan 2025 19:06:52 +0000 (19:06 +0000)] 
BSD: FreeBSD allows RTA_IFP correctly.

Not that it allows the same IPv6 address on different interfaces
on the same network still, but that's a FreeBSD issue to fix later.

The last for #407

5 months agoBSD: Note that to replicate prior we can't have a default route
Roy Marples [Wed, 15 Jan 2025 18:51:46 +0000 (18:51 +0000)] 
BSD: Note that to replicate prior we can't have a default route

Add a comment for #425

5 months agorevert e3c5de1 (#425)
philomathic_life [Wed, 15 Jan 2025 10:30:03 +0000 (10:30 +0000)] 
revert e3c5de1 (#425)

5 months agoAdd route lifetime from Router Advertisement (#429)
Colin McInnes [Wed, 15 Jan 2025 10:29:14 +0000 (04:29 -0600)] 
Add route lifetime from Router Advertisement (#429)

Currently this is only for Linux and is fairly cosmetic as dhcpcd will
clean up expired routes itself as other OS's don't support route lifetimes.

6 months agoExit the timesyncd hook if not on systemd and not executable (#398) (#403)
Martin-Éric RACINE [Sun, 8 Dec 2024 09:49:44 +0000 (11:49 +0200)] 
Exit the timesyncd hook if not on systemd and not executable (#398) (#403)

Exit the timesyncd hook immediately if not running on a systemd host AND timesyncd is not executable.

6 months agolinux: Allow the __NR_rt_sigprocmask syscall
Scott Shambarger [Sat, 7 Dec 2024 16:37:28 +0000 (16:37 +0000)] 
linux: Allow the __NR_rt_sigprocmask syscall

Fixes recent glibc changes to getrandom() used by arc4random().
Fixes #421.

6 months agoIPv6: Discard NA packets with a zero length option
Roy Marples [Sat, 7 Dec 2024 10:25:44 +0000 (10:25 +0000)] 
IPv6: Discard NA packets with a zero length option

As per RFC 4861 4.6.

Fixes #415.

6 months agoDHCP: reduce buflen by 2 when creating a new RFC 3396 option
Billie Alsup [Sat, 7 Dec 2024 07:42:38 +0000 (07:42 +0000)] 
DHCP: reduce buflen by 2 when creating a new RFC 3396 option

Fixes #418 and potential buffer overflow.

7 months agoDHCPv6: Add support for sending Option 17 (VSIO) (#383) 378/head
spoljak-ent [Thu, 7 Nov 2024 13:15:49 +0000 (14:15 +0100)] 
DHCPv6: Add support for sending Option 17 (VSIO) (#383)

* DHCP: Add support for sending DHCP option 125 and DHCPv6 Option 17 (VSIO)

Note wireshark doesn't decode option 125 correctly when the it needs to be split into more options if it exceeds 255 bytes.
---------

Signed-off-by: Stipe Poljak (EXT) <stipe.poljak.ext@ericsson.com>
Co-authored-by: Roy Marples <roy@marples.name>
8 months agologerr: use LOG_NDELAY for openlog
Roy Marples [Thu, 31 Oct 2024 10:40:46 +0000 (10:40 +0000)] 
logerr: use LOG_NDELAY for openlog

This ensures openlog gets a fd so logging of errors can occur
within privsep where no log was written before entering privsep.
Also ensures that closelog does not close -1 on some platforms
where no logging took place.

8 months agoIPv6: Avoid uninitialized ifp state when adding address (#395)
Ken Simon [Tue, 29 Oct 2024 23:11:54 +0000 (19:11 -0400)] 
IPv6: Avoid uninitialized ifp state when adding address (#395)

In certain instances, `ifp->if_data[IF_DATA_IPV6]` was not yet
initialized when ipv6_addaddr adds the address to the state, and a
segfault would ensue. Mitigate this by ensuring the state is initialized
when adding the addresses.

fixes #394

8 months agoDon't set RLIMIT_FSIZE when dumping lease (#389)
Colin McInnes [Tue, 29 Oct 2024 15:30:59 +0000 (09:30 -0600)] 
Don't set RLIMIT_FSIZE when dumping lease (#389)

Check if output is a tty
If dumping lease, check stdout otherwise check stderr.

---------

Co-authored-by: Roy Marples <roy@marples.name>
8 months agoDHCP6: lastlease behavior after Confirm non-response (#387)
Jon Franklin [Tue, 29 Oct 2024 07:53:51 +0000 (02:53 -0500)] 
DHCP6: lastlease behavior after Confirm non-response (#387)

If lastlease is enabled, and dhcpcd is unable to confirm its prior
lease, after timeout, bind the lease and move to the REBIND state.
Confine lastlease behavior to the CONFIRM and REBIND states.

Co-authored-by: Jon Franklin <jon_franklin@dell.com>
8 months agolinux: ignore source-based routes (#372)
Scott Shambarger [Tue, 29 Oct 2024 07:52:45 +0000 (00:52 -0700)] 
linux: ignore source-based routes (#372)

Since source-based routes aren't used by dhcpcd, it's best if they
are ignored so that they aren't confused with default routes.

8 months agoIPv6: Improve comments on prior global for default route change
Roy Marples [Mon, 14 Oct 2024 17:03:18 +0000 (18:03 +0100)] 
IPv6: Improve comments on prior global for default route change

8 months agoApply lastlease behavior to DHCPv6 (#384)
Jon Franklin [Mon, 14 Oct 2024 12:58:24 +0000 (07:58 -0500)] 
Apply lastlease behavior to DHCPv6 (#384)

If no response is received to Confirm messages, instead of failing, go
ahead and use the lease, as recommended by RFC 8415 18.2.3.

8 months agoIPv6: allow any global address for default route
Roy Marples [Mon, 14 Oct 2024 09:48:23 +0000 (10:48 +0100)] 
IPv6: allow any global address for default route

Regardless if we are a router or not.
BSD IPv6 source address selection does really matter for this.

This fixes FreeBSD systes where the forwarding sysctl is set
by the routing script which starts late in the day where
dhcpcd is already running and won't get the default route applied
until another RA comes in which could be a while.

8 months agoDHCP6: add preference as a defined option
Roy Marples [Fri, 11 Oct 2024 17:16:26 +0000 (18:16 +0100)] 
DHCP6: add preference as a defined option

8 months agoFix help text formatting (#379)
jvfranklin [Thu, 10 Oct 2024 13:52:49 +0000 (08:52 -0500)] 
Fix help text formatting (#379)

8 months agolinux: Support old kernels by not including linux/if.h
Roy Marples [Thu, 10 Oct 2024 13:19:46 +0000 (14:19 +0100)] 
linux: Support old kernels by not including linux/if.h

I wish the linux team used #defines rather than enums, but heh ho.
Ensure we can test IFF_LOWER_UP, IFF_DORMANT and IFA_FLAGS
based on nearest matching #defines available when the respective
feature was comitted.

Fixes #373.

8 months agohooks: Document if_configured
Roy Marples [Thu, 10 Oct 2024 10:59:04 +0000 (11:59 +0100)] 
hooks: Document if_configured

Fixes #353

8 months agodhcpcd: stdout output sometimes empty when redirected to a file (#364)
Diego Santa cruz [Thu, 10 Oct 2024 10:45:34 +0000 (12:45 +0200)] 
dhcpcd: stdout output sometimes empty when redirected to a file (#364)

Running dhpcd --dumplease with input from stdin and redirecting stdout
to a file outputs nothing to the output. The reason is that printf /
fprintf is used to write the output but it is not explicitly flushed
when done, or before exiting, and stdout to files is fully buffered by
default while stdout to terminals is line buffered by default.

This adds calls to fflush() at the end of dhcp_print_option_encoding()
and script_dump(), plus one just before exiting dhcpcd.

Signed-off-by: Diego Santa Cruz <diego.santacruz@spinetix.com>
8 months agoIPv6: Mark Route Information Routes as from RA 374/head
Roy Marples [Thu, 10 Oct 2024 10:10:11 +0000 (11:10 +0100)] 
IPv6: Mark Route Information Routes as from RA

8 months agoIPv6: Don't set IN6_IFF_TENTATIVE when the address exists
Roy Marples [Wed, 9 Oct 2024 10:19:56 +0000 (11:19 +0100)] 
IPv6: Don't set IN6_IFF_TENTATIVE when the address exists

We can only work it out when we know the address, not beforehand.

8 months agoDHCP6: Discard less preferred ADVERTISMENTs until IRT
Roy Marples [Tue, 8 Oct 2024 13:34:02 +0000 (14:34 +0100)] 
DHCP6: Discard less preferred ADVERTISMENTs until IRT

If we get a preference value of 255 then request immediately.
More RFC 8415 18.2.1 support, inspired by #376.

8 months agodhcp6: start request when advertise received after IRT (#376)
Scott Shambarger [Tue, 8 Oct 2024 13:26:04 +0000 (06:26 -0700)] 
dhcp6: start request when advertise received after IRT (#376)

After the initial solicit timeout, any received advertisements trigger
a request.  However, after the timeout, any advertisements will
never result in a request, and the client sends solicits forever.

This patch adds sends a request in response to an advertise if the
initial timeout has expired.

Cleanup: removes a check for an impossible state.

8 months agoBSD: Remove IPv6 sharing warning
Roy Marples [Mon, 7 Oct 2024 11:10:11 +0000 (12:10 +0100)] 
BSD: Remove IPv6 sharing warning

This doesn't seem to be needed for on recent FreeBSD and OpenBSD.

9 months agoRelease dhcpcd-10.1.0 v10.1.0
Roy Marples [Fri, 4 Oct 2024 21:22:24 +0000 (22:22 +0100)] 
Release dhcpcd-10.1.0

9 months agoFinal fix for prior
Roy Marples [Fri, 4 Oct 2024 16:35:09 +0000 (17:35 +0100)] 
Final fix for prior