]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
17 hours agoprivsep: Don't abort if we don't need a fdwaiter master
Roy Marples [Wed, 3 Jun 2026 14:35:34 +0000 (15:35 +0100)] 
privsep: Don't abort if we don't need a fdwaiter

19 hours agodhcpcd: Don't add a link_fd if we don't have one.
Roy Marples [Wed, 3 Jun 2026 12:28:53 +0000 (13:28 +0100)] 
dhcpcd: Don't add a link_fd if we don't have one.

21 hours agoroute: Rework rt structure so sockaddrs are pointers (#621)
Roy Marples [Wed, 3 Jun 2026 10:27:09 +0000 (11:27 +0100)] 
route: Rework rt structure so sockaddrs are pointers (#621)

For each sockaddr, put a sockaddr_storage in the rt and
reference it.
This removes the need of a union and the macro dance
around it.

43 hours agocompat: Add support for getprogname(3)
Roy Marples [Tue, 2 Jun 2026 12:26:28 +0000 (13:26 +0100)] 
compat: Add support for getprogname(3)

Removes all inlined variations into a common single one.
Only supports Linux (which is all we did anyway), but now adds detection for program_invocation_short_name in libc and will use that OR package name.
All Linux libc should support this.

2 days agoscript: Don't assume AF_PACKET of if not AF_LINK
Roy Marples [Mon, 1 Jun 2026 21:07:06 +0000 (22:07 +0100)] 
script: Don't assume AF_PACKET of if not AF_LINK

2 days agoBPF: Improve headers
Roy Marples [Mon, 1 Jun 2026 20:20:01 +0000 (21:20 +0100)] 
BPF: Improve headers

2 days agoeloop: mark eloop as UNUSED for waitfd and ppoll
Roy Marples [Mon, 1 Jun 2026 19:35:30 +0000 (20:35 +0100)] 
eloop: mark eloop as UNUSED for waitfd and ppoll

2 days agoAdapt codebase for new pidfile
Roy Marples [Mon, 1 Jun 2026 18:43:11 +0000 (19:43 +0100)] 
Adapt codebase for new pidfile

2 days agopidfile: Import latest from NetBSD
Roy Marples [Mon, 1 Jun 2026 18:42:11 +0000 (19:42 +0100)] 
pidfile: Import latest from NetBSD

Features improved chroot and sandbox support.

7 days agoeloop: set errno = EBADF rather than calling close if waitfd == -1
Roy Marples [Wed, 27 May 2026 13:59:45 +0000 (14:59 +0100)] 
eloop: set errno = EBADF rather than calling close if waitfd == -1

This avoids valgrind complaining.

10 days agoDarwin: Add initial support for macOS (#613)
Roy Marples [Sun, 24 May 2026 15:19:01 +0000 (16:19 +0100)] 
Darwin: Add initial support for macOS (#613)

Apple route(4) has some limitations as does getifaddrs(3).
Basically there is no means of being notified of carrier state
because Apple only reports this via media state which is an ioctl.

The good news is that we can build macOS on github so we
can get some BSD traceability at least.

Fixes #524

13 days agoeloop: fix USE_PPOLL define
Roy Marples [Thu, 21 May 2026 23:36:42 +0000 (00:36 +0100)] 
eloop: fix USE_PPOLL define

13 days agoprivsep: Adapt to new eloop_waitfd()
Roy Marples [Thu, 21 May 2026 22:58:56 +0000 (23:58 +0100)] 
privsep: Adapt to new eloop_waitfd()

13 days agoeloop: Add eloop_openfdwaiter() and eloop_closefdwaiter()
Roy Marples [Thu, 21 May 2026 22:48:45 +0000 (23:48 +0100)] 
eloop: Add eloop_openfdwaiter() and eloop_closefdwaiter()

Use kqueue or epoll for eloop_waitfd().
This requires opening a new kqueue or epoll to handle this as
this is a one shot event we don't want to touch the eloop events.

This works with RLIMIT_NOFILE = 0.

13 days agoDHCP6: Delete the eloop event before closing an ia listener socket
Roy Marples [Thu, 21 May 2026 07:43:58 +0000 (08:43 +0100)] 
DHCP6: Delete the eloop event before closing an ia listener socket

This only happens when dhcpcd is running on a specific interface
and can trigger erroneous logs deleting the socket from
kqueue/epoll.
With the prior eloop it could also trigger ia events from a
non related fd if re-used.

Hopefully fixes #596.

13 days agoeloop: always remove event from list on delete
Roy Marples [Thu, 21 May 2026 07:39:55 +0000 (08:39 +0100)] 
eloop: always remove event from list on delete

Event if kevent or epoll return an error from the operation.
We still return the error so the caller can log a diagnostic.

Thanks to Graham Northup for the hint.
May help with #596.

2 weeks agoMerge pull request #610 from NetworkConfiguration/esc_ifname
Roy Marples [Tue, 19 May 2026 16:15:56 +0000 (17:15 +0100)] 
Merge pull request #610 from NetworkConfiguration/esc_ifname

hooks: Escape interface names and use printf

2 weeks agohooks: Escape interface names and use printf 610/head
Joan Lledó [Tue, 19 May 2026 14:21:54 +0000 (15:21 +0100)] 
hooks: Escape interface names and use printf

In the Hurd, interface names can include invalid characters like `/`.
So those must be escaped.

2 weeks agoMerge pull request #607 from NetworkConfiguration/bpf
Roy Marples [Tue, 19 May 2026 12:04:22 +0000 (13:04 +0100)] 
Merge pull request #607 from NetworkConfiguration/bpf

BPF: Split OS specific code out into own files and add libpcap support

2 weeks agoBPF: Correct libpcap warning 607/head
Roy Marples [Tue, 19 May 2026 11:37:27 +0000 (12:37 +0100)] 
BPF: Correct libpcap warning

2 weeks agoBPF: Add a DLPI interface
Roy Marples [Tue, 19 May 2026 11:31:04 +0000 (12:31 +0100)] 
BPF: Add a DLPI interface

This works alongside the BSD interface.
We use the BSD interface for receiving and the DLPI interface
for sending.

2 weeks agoBPF: Test for pcap_set_immediate_mode()
Roy Marples [Tue, 19 May 2026 11:23:59 +0000 (12:23 +0100)] 
BPF: Test for pcap_set_immediate_mode()

2 weeks agoBPF: harden libpcap on BSD
Roy Marples [Tue, 19 May 2026 10:59:43 +0000 (11:59 +0100)] 
BPF: harden libpcap on BSD

It's unlikely that pcap_setwritefilter() and pcap_lockfilter()
will make it into a release, so harden a pcap without these ourself
for the time being.

2 weeks agoBPF: Use pcap_setwritefilter() and pcap_lockfilter()
Roy Marples [Sun, 17 May 2026 15:38:22 +0000 (16:38 +0100)] 
BPF: Use pcap_setwritefilter() and pcap_lockfilter()

If available.
Upstream PR: https://github.com/the-tcpdump-group/libpcap/pull/1683

2 weeks agoBPF: Address review comments
Roy Marples [Sun, 17 May 2026 12:12:23 +0000 (13:12 +0100)] 
BPF: Address review comments

2 weeks agoBPF: Add support for libpcap
Joan Lledó [Fri, 15 May 2026 09:30:24 +0000 (10:30 +0100)] 
BPF: Add support for libpcap

This makes it easier to support OS's where we don't have kernel
support for any BPF ourselves, such as GNU/Hurd.

2 weeks agoBPF: Fixup comment to indicate this could be used outside of dhcpcd
Roy Marples [Fri, 15 May 2026 08:57:34 +0000 (09:57 +0100)] 
BPF: Fixup comment to indicate this could be used outside of dhcpcd

2 weeks agoBPF: Simplify by splitting OS specifics into own files
Roy Marples [Thu, 14 May 2026 20:36:09 +0000 (21:36 +0100)] 
BPF: Simplify by splitting OS specifics into own files

3 weeks agoprivsep: Change IPC to use SOCK_STREAM (#604)
Roy Marples [Sat, 9 May 2026 12:13:56 +0000 (13:13 +0100)] 
privsep: Change IPC to use SOCK_STREAM (#604)

macOS does not support SOCK_SEQPACKET.

All our messages use a fixed header which includes the
lengths of all parts sent.
We can use these limits with MSG_WAITALL on blocking sockets
in place of MSG_EOR to get the same effect.

Start of the work for #524.

4 weeks agoformat: Ensure <netinet/icmp6.h> comes before <netinet/in.h>
Roy Marples [Tue, 5 May 2026 13:37:29 +0000 (14:37 +0100)] 
format: Ensure <netinet/icmp6.h> comes before <netinet/in.h>

4 weeks agoeloop: Bring in updated from dhcpsd
Roy Marples [Tue, 5 May 2026 09:56:30 +0000 (10:56 +0100)] 
eloop: Bring in updated from dhcpsd

* Initial Darwin/macOS support
* Close epoll fd on fork
* Use poll as ppoll may not be available when waiting for a fd

4 weeks agoFormat code with clang-format v19 (#601)
Roy Marples [Thu, 30 Apr 2026 16:44:47 +0000 (17:44 +0100)] 
Format code with clang-format v19 (#601)

Using a template taken from FreeBSD
Add a github action to enforce this

4 weeks agoAdd missing SPDX-License tags (#591)
Colin McInnes [Thu, 30 Apr 2026 16:42:43 +0000 (10:42 -0600)] 
Add missing SPDX-License tags (#591)

* Add missing SPDX-License tags

If copyright block is present, add missing SPDX-License tag

If copyright block is not present, add one. Use BSD-3-Clause and infer author list from git blame.

Resolves #570

* Ensure all non-copyrighted files are BSD-2

Overall project is BSD-2, not 3, so ensure any new license header was BSD-2.

General formatting cleanup.

* Update md5.h to put SPDX copyright in correct place

Brain fart, I put it right before the line containing "copyright" but that was in the middle of a sentence.

4 weeks agoRelease dhcpcd-10.3.2 v10.3.2
Roy Marples [Thu, 30 Apr 2026 13:38:32 +0000 (14:38 +0100)] 
Release dhcpcd-10.3.2

2 months agoDHCP: free the state when dropping on state NONE
Roy Marples [Mon, 23 Mar 2026 15:31:01 +0000 (15:31 +0000)] 
DHCP: free the state when dropping on state NONE

Fixes an issue when dhcpcd tries to release when the carrier
is down.

Fixes #560

2 months agoDHCP: Don't run double EXPIRE hooks on carrier loss
Roy Marples [Thu, 19 Mar 2026 11:39:40 +0000 (11:39 +0000)] 
DHCP: Don't run double EXPIRE hooks on carrier loss

Fixes #587.

2 months agoRelease dhcpcd-10.3.1 v10.3.1
Roy Marples [Mon, 16 Mar 2026 12:03:38 +0000 (12:03 +0000)] 
Release dhcpcd-10.3.1

2 months agoFix guards for prior
Roy Marples [Mon, 16 Mar 2026 11:45:01 +0000 (11:45 +0000)] 
Fix guards for prior

2 months agoBSD: don't send uninitialised memory using ps_root_indirectioctl
Roy Marples [Fri, 6 Mar 2026 23:02:36 +0000 (23:02 +0000)] 
BSD: don't send uninitialised memory using ps_root_indirectioctl

This will affect FreeBSD and OpenBSD.
Use sendmsg to send the length of the interface name, then the
interface name and then the data rather than just sending
IFNAMSIZ which may have uninitialised bytes at the end.

Opimise ps_sendcmdmsg while here.
Hopefully helps #565 but I'm not hopeful.

2 months agomanager: Fix loosing iface options on CARRIER
Daniel Gröber [Fri, 6 Mar 2026 22:47:42 +0000 (22:47 +0000)] 
manager: Fix loosing iface options on CARRIER

When an interface (re-)gains carrier dhcpcd_handlecarrier() runs
dhcpcd_initstate() to kick off profile re-selection. Previously this used
args originally passed when starting the manager (ctx->argv).

However interfaces started via the manager control
interface (dhcpcd_initstate1() in dhcpcd_handleargs()) may be started with
different args.

For example if we start a manager with

    dhcpcd -M --inactive

and then start only IPv4 on an interface with

    dhcpcd -4 iface0

a subsequent CARRIER event will reset the interface to what amounts to
"default config + `-M --inactive`" which in this case will enable ipv6
also!

To fix this we keep a copy of the arguments used to start an interface in
the manager (dhcpcd_handleargs()) code path around around (ifp->argv).

In the current implementation args passed for renew following the initial
interface start will not be persisted. This causes the interface to reset
to a state of "defaults + config + profile + start-cmdline".

For example (continuing the scenario above) after enabling ipv6 with -n:

    $ dhcpcd -6 -n iface0

A subsequent CARRIER event will disable ipv6 again as the effective
arguments remain `-4 iface0` as passed during interface start.

Note the per-interface daemon code path wasn't affected as ctx->args
already contains the interface start args.

2 months agontp: Build new_ntp_servers without superfluous spaces
Roy Marples [Fri, 6 Mar 2026 11:48:30 +0000 (11:48 +0000)] 
ntp: Build new_ntp_servers without superfluous spaces

Fixes #582.

3 months agoroute: fix a bogus uninitialised check from clang
Roy Marples [Thu, 26 Feb 2026 23:06:38 +0000 (23:06 +0000)] 
route: fix a bogus uninitialised check from clang

3 months agoipv6nd: empty IPV6RA_EXPIRE eloop queue when dropping
Roy Marples [Thu, 26 Feb 2026 17:58:42 +0000 (17:58 +0000)] 
ipv6nd: empty IPV6RA_EXPIRE eloop queue when dropping

Fixes #584

Helps #566

3 months agoDHCP: Add parentheses to macro definitions
acst1223 [Thu, 26 Feb 2026 08:35:12 +0000 (17:35 +0900)] 
DHCP: Add parentheses to macro definitions

Missing parentheses in IP_UDP_SIZE caused wrong computation of MSZ
(option57). When mtu is 1500, current MSZ value is 1488=1500-20+8, while
the correct value should be 1472=1500-(20+8).

Also added parentheses for BOOTP_MIN_MTU.

3 months agoprivsep: Ensure we recv for real after a successful recv MSG_PEEK
Roy Marples [Tue, 17 Feb 2026 12:48:55 +0000 (12:48 +0000)] 
privsep: Ensure we recv for real after a successful recv MSG_PEEK

* privsep: Ensure we recv for real after a successful recv MSG_PEEK

Adjust the code flow so that the same errors would be caught
after the final recv.
This ensures we read what is really meant for us and not
something silly.

Return EBADMSG on recvmsg len mismatch.

4 months agocommon: Cast via uintptr_t rather than unsigned long in UNCONST (#581)
Jessica Clarke [Fri, 9 Jan 2026 21:56:25 +0000 (21:56 +0000)] 
common: Cast via uintptr_t rather than unsigned long in UNCONST (#581)

On ILP32 and LP64 systems, unsigned long is sufficient to round-trip
pointers, but on LLP64 systems it is too small, and on systems like
CHERI where pointers are capabilities, it does not propagate capability
metadata, and casting back to a pointer to yield a pointer that cannot
be dereferenced.

Instead, cast via uintptr_t to ensure we always use an integral type
that can losslessly round-trip pointers.

5 months agooptions: Don't assume vsio options have an argument (#578)
Roy Marples [Wed, 31 Dec 2025 10:12:24 +0000 (10:12 +0000)] 
options: Don't assume vsio options have an argument (#578)

* options: Don't assume vsio options have an argument

Should fix #577.

5 months agooptions: Ensure that an overly long bitflag string does not crash (#576)
Roy Marples [Tue, 30 Dec 2025 21:36:24 +0000 (21:36 +0000)] 
options: Ensure that an overly long bitflag string does not crash (#576)

Fixes #573.

5 months agoroute: Routes may not have an interface assinged (#572)
Roy Marples [Tue, 30 Dec 2025 07:28:00 +0000 (07:28 +0000)] 
route: Routes may not have an interface assinged (#572)

As such, we cannot access dhcpcd_ctx so we can't use the free
route list.
Fixes #571.

5 months agooptions: Ensure ldop is not NULL dereferenced (#568)
Roy Marples [Sun, 21 Dec 2025 08:31:52 +0000 (08:31 +0000)] 
options: Ensure ldop is not NULL dereferenced (#568)

ldop itself cannot be non NULL as it points to the location.
but *ldop CAN be NULL.

Fixes #567.

5 months agoIPv4: Ignore DHCP state when building routes (#557)
Roy Marples [Thu, 4 Dec 2025 09:26:57 +0000 (09:26 +0000)] 
IPv4: Ignore DHCP state when building routes (#557)

* IPv4: Ignore DHCP state when building routes

As this will change periodically.
We only care if the state (address) has been added.

Fixes #440 thanks to JognSmit.

6 months agoFix fallback_time option (#562)
Colin McInnes [Wed, 3 Dec 2025 09:41:04 +0000 (03:41 -0600)] 
Fix fallback_time option (#562)

Fallback time option was updating request_time instead of fallback_time.

Resolves #561

6 months agoDHCP6: Don't restart INFORM timers on subsequent failure.
Roy Marples [Tue, 18 Nov 2025 12:08:26 +0000 (12:08 +0000)] 
DHCP6: Don't restart INFORM timers on subsequent failure.

6 months agoRelease dhcpcd-10.3.0 v10.3.0
Roy Marples [Fri, 14 Nov 2025 15:38:04 +0000 (15:38 +0000)] 
Release dhcpcd-10.3.0

6 months agoeloop: remove epoll_pwait2 support
Roy Marples [Fri, 14 Nov 2025 15:34:51 +0000 (15:34 +0000)] 
eloop: remove epoll_pwait2 support

It's just not there on musl, detecting it at compile time
is hit and miss on glibc due to mismatched kernel headers.

6 months agoeloop: Simplify ppoll a little
Roy Marples [Fri, 14 Nov 2025 15:05:39 +0000 (15:05 +0000)] 
eloop: Simplify ppoll a little

6 months agoinstall queue.h
Roy Marples [Fri, 14 Nov 2025 14:52:33 +0000 (14:52 +0000)] 
install queue.h

6 months agoeloop: Work with fortified compilers
Roy Marples [Fri, 14 Nov 2025 14:52:19 +0000 (14:52 +0000)] 
eloop: Work with fortified compilers

6 months agoAdapt to new eloop.
Roy Marples [Fri, 14 Nov 2025 13:08:58 +0000 (13:08 +0000)] 
Adapt to new eloop.

6 months agoeloop: Replace the inner eloop concept with waitfd
Roy Marples [Fri, 14 Nov 2025 13:08:21 +0000 (13:08 +0000)] 
eloop: Replace the inner eloop concept with waitfd

This is what we really want and saves the massive headache of
managing two loops.

6 months agoBSD: Reject routes are not cloned/connected routes
Roy Marples [Thu, 13 Nov 2025 14:40:02 +0000 (14:40 +0000)] 
BSD: Reject routes are not cloned/connected routes

Likewise, if we change from a reject to a non reject route
we need to remove it rather than changing it as some BSD
kernels preserve the RTF_GATEWAY flag.

6 months agoscript: STOP should not set if_down=true
Roy Marples [Thu, 13 Nov 2025 11:19:38 +0000 (11:19 +0000)] 
script: STOP should not set if_down=true

6 months agoeloop: formatting
Roy Marples [Tue, 11 Nov 2025 13:18:39 +0000 (13:18 +0000)] 
eloop: formatting

6 months agoProtocols will notify when dhcpcd can exit (#536)
Roy Marples [Tue, 11 Nov 2025 13:13:03 +0000 (13:13 +0000)] 
Protocols will notify when dhcpcd can exit (#536)

* Protocols will notify when dhcpcd can exit

DHCPv6 RELEASE requires the addresses to be dropped before
a RELEASE message is sent.
We now wait for an acknowledgement or a timeout before notifying
that DHCPv6 has stopped for the interface.

DHCPv4 RELEASE is the other way around, there is no acknowledgement.
So we wait for 1 second after sending the message before removing
the address and notifying DHCP has stopped for the interface.

If we are not releasing then we notify dhcpcd that the protocol has
stopped right away when we drop the lease.

dhcpcd will exit once there are no running protocols for the
interfaces.

Fixes #513.
Hopefully #535, #519 and #509 as well.

Co-authored-by: Sime Zupanovic (EXT) <sime.zupanovic.ext@ericsson.com>
6 months agoeloop: Try and fix clean compile on all BSD
Roy Marples [Tue, 11 Nov 2025 11:32:12 +0000 (11:32 +0000)] 
eloop: Try and fix clean compile on all BSD

6 months agoeloop: Fix epoll for prior
Roy Marples [Tue, 11 Nov 2025 11:20:31 +0000 (11:20 +0000)] 
eloop: Fix epoll for prior

6 months agoeloop: Simplify kqueue implementation
Roy Marples [Tue, 11 Nov 2025 11:07:21 +0000 (11:07 +0000)] 
eloop: Simplify kqueue implementation

Easier to read, reduces binary size at a small cost of
more kevents when forking and keeping fd's which
is acceptable.

6 months agodhcpcd: log error on eloop_signal_set_cb failure
Roy Marples [Tue, 11 Nov 2025 10:36:36 +0000 (10:36 +0000)] 
dhcpcd: log error on eloop_signal_set_cb failure

6 months agoprivsep: we might not have a root process
Roy Marples [Tue, 11 Nov 2025 07:21:09 +0000 (07:21 +0000)] 
privsep: we might not have a root process

6 months agoeloop: Fix kqueue on FreeBSD
Roy Marples [Mon, 10 Nov 2025 22:22:02 +0000 (22:22 +0000)] 
eloop: Fix kqueue on FreeBSD

6 months agocompat: Fix sha256 on Dragonfly at least
Roy Marples [Mon, 10 Nov 2025 22:02:49 +0000 (22:02 +0000)] 
compat: Fix sha256 on Dragonfly at least

6 months agoeloop: exit all eloops when stopping on signals
Roy Marples [Mon, 10 Nov 2025 20:00:20 +0000 (20:00 +0000)] 
eloop: exit all eloops when stopping on signals

6 months agoeloop: for kqueue and epoll, grow the receiving event list as needed.
Roy Marples [Mon, 10 Nov 2025 19:44:01 +0000 (19:44 +0000)] 
eloop: for kqueue and epoll, grow the receiving event list as needed.

6 months agoprivsep: Drain the log when the root process is exiting
Roy Marples [Wed, 5 Nov 2025 10:00:55 +0000 (10:00 +0000)] 
privsep: Drain the log when the root process is exiting

So we stand a better chance of printing the exit messages.

7 months agoeloop: total events to listen to is nfds, not nevents
Roy Marples [Mon, 3 Nov 2025 09:44:55 +0000 (09:44 +0000)] 
eloop: total events to listen to is nfds, not nevents

Only important for kqueue when there are only signals and timeouts
in play.

7 months agoNetBSD: Delete RTF_CONNECTED route when changing it.
Roy Marples [Sun, 2 Nov 2025 06:44:27 +0000 (06:44 +0000)] 
NetBSD: Delete RTF_CONNECTED route when changing it.

We need to flush anything dynamically created.

7 months agoFix compile on Alpine linux
Roy Marples [Fri, 31 Oct 2025 08:18:55 +0000 (08:18 +0000)] 
Fix compile on Alpine linux

7 months agoFix eloop test
Roy Marples [Fri, 31 Oct 2025 07:38:38 +0000 (07:38 +0000)] 
Fix eloop test

7 months agoprivsep: Fix reading results from root process
Roy Marples [Fri, 31 Oct 2025 07:29:10 +0000 (07:29 +0000)] 
privsep: Fix reading results from root process

Should be the final fallout from the new eloop.

7 months agoFix compile with rbtree and queue on Linux
Roy Marples [Fri, 31 Oct 2025 07:28:53 +0000 (07:28 +0000)] 
Fix compile with rbtree and queue on Linux

7 months agoeloop: Fix a memory leak
Roy Marples [Fri, 31 Oct 2025 07:27:33 +0000 (07:27 +0000)] 
eloop: Fix a memory leak

7 months agoFix some fallout from prior
Roy Marples [Thu, 30 Oct 2025 19:08:32 +0000 (19:08 +0000)] 
Fix some fallout from prior

7 months agoAdjust for new eloop.
Roy Marples [Thu, 30 Oct 2025 14:09:28 +0000 (14:09 +0000)] 
Adjust for new eloop.

Needs more testing.

7 months agoeloop: Import latest from dhcpsd
Roy Marples [Thu, 30 Oct 2025 14:07:54 +0000 (14:07 +0000)] 
eloop: Import latest from dhcpsd

Finally have kqueue and epoll working for a multi-process
setup.
The secret sauce was that after forking the fd for polling
is invalid and as such should not be closed blindly.

7 months agoUse rbtree from vendor
Roy Marples [Thu, 30 Oct 2025 13:55:08 +0000 (13:55 +0000)] 
Use rbtree from vendor

It is unexpected for this to exist on anything other than NetBSD.

7 months agoMerge branch 'vendor/RBTREE'
Roy Marples [Thu, 30 Oct 2025 11:53:06 +0000 (11:53 +0000)] 
Merge branch 'vendor/RBTREE'

7 months agoUse queue.h from vendor area rather than system supplied
Roy Marples [Thu, 30 Oct 2025 11:35:32 +0000 (11:35 +0000)] 
Use queue.h from vendor area rather than system supplied

It just makes things easier really than working it out all the
time for differing OS's.

7 months agoMerge branch 'vendor/QUEUE'
Roy Marples [Thu, 30 Oct 2025 11:30:58 +0000 (11:30 +0000)] 
Merge branch 'vendor/QUEUE'

7 months agoImport rbtree.c v1.2 and rbtree.h v1.14 from NetBSD vendor/RBTREE
Roy Marples [Thu, 30 Oct 2025 11:22:30 +0000 (11:22 +0000)] 
Import rbtree.c v1.2 and rbtree.h v1.14 from NetBSD

7 months agoImport queue.h v1.77 from NetBSD vendor/QUEUE
Roy Marples [Thu, 30 Oct 2025 11:19:40 +0000 (11:19 +0000)] 
Import queue.h v1.77 from NetBSD

7 months agoAdd vendor area
Roy Marples [Thu, 30 Oct 2025 11:16:29 +0000 (11:16 +0000)] 
Add vendor area

8 months agoWhen stopping all interfaces at exit and releasing, remove persistance.
Roy Marples [Tue, 30 Sep 2025 16:19:43 +0000 (17:19 +0100)] 
When stopping all interfaces at exit and releasing, remove persistance.

8 months agoipv6: respect slaac hwaddr to really use the hwaddr
Roy Marples [Tue, 30 Sep 2025 12:52:33 +0000 (13:52 +0100)] 
ipv6: respect slaac hwaddr to really use the hwaddr

If the interface has one, otherwise it will fall back to using
the first ipv6 link-local address as before.

8 months agoAdd a .clangd file to aid lsp.
Roy Marples [Tue, 30 Sep 2025 08:43:04 +0000 (09:43 +0100)] 
Add a .clangd file to aid lsp.

8 months agoroute: Don't change them when exiting with persistence.
Roy Marples [Tue, 30 Sep 2025 08:41:18 +0000 (09:41 +0100)] 
route: Don't change them when exiting with persistence.

If an interface stops, it might affect the routing priority.
When dhcpcd is exiting we want to avoid this behaviour to keep
the system running as best as.

8 months agoprivsep: enforce message boundaries with MSG_EOR on our messages (#533)
Gleb Smirnoff [Tue, 30 Sep 2025 07:54:35 +0000 (00:54 -0700)] 
privsep: enforce message boundaries with MSG_EOR on our messages (#533)

privsep: enforce message boundaries with MSG_EOR on our messages

The nature of the SOCK_SEQPACKET, that privsep modules uses, is stream.
See:

https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_10_06

To guarantee that a reader will never read two messages in one read
operation, the writer shall put end of record markers.

The problem exposed itself in FreeBSD 15.0 that started to follow the
specification better than before.

Other SOCK_SEQPACKET usage considerations: a) as long as our reader
provides a receive buffer that would fit the largest message our writer
would ever send, we are good with regards to not a reading a partial
message b) as long as our writer always write full messages with one
write, we don't need use of MSG_WAITALL in reader.

Fixes #530

Co-authored-by: Roy Marples <roy@marples.name>
8 months agoND Route Information Option prefix is optional optional
Roy Marples [Sat, 13 Sep 2025 11:45:50 +0000 (12:45 +0100)] 
ND Route Information Option prefix is optional

As the length could be zero and is RFC compliant.
Fixes #527.

9 months agoDHCP: Put the message type option first
Roy Marples [Thu, 19 Jun 2025 09:15:20 +0000 (10:15 +0100)] 
DHCP: Put the message type option first

There is no ordering requirement from any RFC other than the
recommendations in RFC 7844.
But it seems some DHCP servers really want the message type as
the first option.

Fixes #522.

10 months agoDHCP6: Don't exit if using DHCP4 INFORM in non manager mode
Roy Marples [Sat, 5 Jul 2025 08:20:34 +0000 (09:20 +0100)] 
DHCP6: Don't exit if using DHCP4 INFORM in non manager mode

Fixes #514.

11 months agoDHCP: Request static_routes from dhcpcd.conf 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.