]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
5 months agoDocument that limiting address protocol can affect signalling dhcpcd
Roy Marples [Sun, 10 Dec 2023 08:27:30 +0000 (08:27 +0000)] 
Document that limiting address protocol can affect signalling dhcpcd

Fixes #264

6 months agoFix an unused var warning for capsicum for prior
Roy Marples [Mon, 13 Nov 2023 16:05:04 +0000 (16:05 +0000)] 
Fix an unused var warning for capsicum for prior

6 months agoFix privsep builds for prior.
Roy Marples [Mon, 13 Nov 2023 15:54:50 +0000 (15:54 +0000)] 
Fix privsep builds for prior.

6 months agodhcpcd: Remove stdio callback and detach on daemonise
Roy Marples [Mon, 13 Nov 2023 10:29:58 +0000 (10:29 +0000)] 
dhcpcd: Remove stdio callback and detach on daemonise

For some reason, the stdio callback is extremely flaky on
*some* Linux based distributions making it very hard to debug some
things.
Removing it is fine because we now enforce that we have file descriptors
for stdin, stdout and stdrr on launch and dup them to /dev/null on daemonise.

It's also interesting to see behavioural differences between
some socketpair implementations that emit a HANGUP and some don't.

As such, we now close the fork socket on daemonise once more AND
in the fork_cb depending on if we hangup or read zero first.

Fixes #262

6 months agocontrol: Abort control recv path on hangup
Roy Marples [Mon, 13 Nov 2023 10:24:15 +0000 (10:24 +0000)] 
control: Abort control recv path on hangup

This fixes a crash when we try and re-use it in another function.

6 months agodhcpcd: Detach from launcher before stopping root process
Roy Marples [Sun, 12 Nov 2023 12:16:53 +0000 (12:16 +0000)] 
dhcpcd: Detach from launcher before stopping root process

This fixes non privsep builds where the launcher reports dhcpcd
hungup. Unsure why this happens, but it should not be a problem.

While here, shutdown has no effect on non STREAM sockets and
remove the silly error logging in fork_cb that we read an
error. We already printed the error so this makes no sense.

Hopefully fixes #262.

6 months agocontrol: Fix hangup for non privsep builds
Roy Marples [Sun, 12 Nov 2023 11:30:01 +0000 (11:30 +0000)] 
control: Fix hangup for non privsep builds

Fix related to #262.

6 months agoRelease dhcpcd-10.0.5 v10.0.5
Roy Marples [Fri, 10 Nov 2023 14:25:12 +0000 (14:25 +0000)] 
Release dhcpcd-10.0.5

6 months agoprivsep: Note that unveil(2) is not needed
Roy Marples [Fri, 10 Nov 2023 12:02:19 +0000 (12:02 +0000)] 
privsep: Note that unveil(2) is not needed

As we are in a chroot.
https://www.mail-archive.com/misc@openbsd.org/msg171664.html

6 months agoprivsep: Allow dup3 on Linux
Roy Marples [Thu, 9 Nov 2023 09:21:20 +0000 (09:21 +0000)] 
privsep: Allow dup3 on Linux

It seems some libc will really call dup3 rather than dup2.
Another fix for #260.

6 months agodev: Don't fail to start if we cannot open the dev plugin path
Roy Marples [Wed, 8 Nov 2023 14:27:36 +0000 (14:27 +0000)] 
dev: Don't fail to start if we cannot open the dev plugin path

We accidently returned stdin fd in this case - return -1 instead.

6 months agodhcpcd: Close fork_fd on hangup
Roy Marples [Wed, 8 Nov 2023 11:09:52 +0000 (11:09 +0000)] 
dhcpcd: Close fork_fd on hangup

Closing it early results in zero length reads in some situations.
Logging that we forked via the launcher process also make more sense
and allows us to use log* functions.

While here, handle error condtions better by forcing a return
rather than handling an invalid state.

Fixes #260.

6 months agoconfigure: guard config.h with #ifdef CONFIG_H
Roy Marples [Wed, 8 Nov 2023 10:10:35 +0000 (10:10 +0000)] 
configure: guard config.h with #ifdef CONFIG_H

Rename CONFIG_H guard in defs.h to DEFS_H
This avoids a redeclaration issue on DragonFly.

6 months agoIPv4LL: Don't start if already started
Roy Marples [Mon, 23 Oct 2023 15:25:13 +0000 (15:25 +0000)] 
IPv4LL: Don't start if already started

It's just pointless noise.
A follow-on fix for #255.

6 months agoDHCP: re-enter DISCOVER phase if server doesn't reply to our REQUEST
Roy Marples [Mon, 23 Oct 2023 15:24:00 +0000 (15:24 +0000)] 
DHCP: re-enter DISCOVER phase if server doesn't reply to our REQUEST

Use the reboot timeout as per the initial DISCOVER timeout.

Fixes #255

6 months agoExpose memset_s on FreeBSD
Roy Marples [Mon, 23 Oct 2023 14:39:20 +0000 (15:39 +0100)] 
Expose memset_s on FreeBSD

6 months agoFix tests or #252.
Roy Marples [Mon, 23 Oct 2023 14:31:02 +0000 (15:31 +0100)] 
Fix tests or #252.

6 months agocompat: test for memset_explicit, explicit_bzero and memset_s
Roy Marples [Mon, 23 Oct 2023 14:26:16 +0000 (15:26 +0100)] 
compat: test for memset_explicit, explicit_bzero and memset_s

These won't be optimised away by the compiler and our arc4random
compat function should use them *if* available.
If none are then a warning will be emitted to say it's potentially insecure.

Hopefully only uclibc users will see this message.

Fixes #252.

6 months agoImprove comment about capturing script output.
Roy Marples [Fri, 20 Oct 2023 06:53:20 +0000 (06:53 +0000)] 
Improve comment about capturing script output.

6 months agoRelease dhcpcd-10.0.4 v10.0.4
Roy Marples [Thu, 19 Oct 2023 11:15:31 +0000 (12:15 +0100)] 
Release dhcpcd-10.0.4

6 months agodhcpcd: Improve script status handling
Roy Marples [Thu, 19 Oct 2023 11:06:22 +0000 (12:06 +0100)] 
dhcpcd: Improve script status handling

6 months agoprivsep: Allow dup2 with SECCOMP
Roy Marples [Thu, 19 Oct 2023 10:34:30 +0000 (11:34 +0100)] 
privsep: Allow dup2 with SECCOMP

6 months agoprivsep: Notify processes when dhcpcd has daemonised
Roy Marples [Thu, 19 Oct 2023 10:11:05 +0000 (11:11 +0100)] 
privsep: Notify processes when dhcpcd has daemonised

This allows us to dup stdout and stderr onto stdin which is
guaranteed to be dupped to /dev/null.
This in turn avoids SIGPIPE when the privileged proccess launches
the script and it wants to write to stdout/stderr or stupidly
read from stdin.

7 months agocompat/arc4random.c: use memset instead of explicit_bzero (#252)
Fabrice Fontaine [Mon, 16 Oct 2023 17:03:41 +0000 (19:03 +0200)] 
compat/arc4random.c: use memset instead of explicit_bzero (#252)

Use memset instead of explicit_bzero to avoid the following build
failure with uclibc-ng since version 10.0.3 and
https://github.com/NetworkConfiguration/dhcpcd/commit/837d09e34c487edaa92aa2ae71a630d84c927f8e:

/home/fabrice/buildroot/output/host/lib/gcc/arm-buildroot-linux-uclibcgnueabi/12.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: ../compat/arc4random.o: in function `_rs_stir_if_needed':
arc4random.c:(.text+0x8cc): undefined reference to `explicit_bzero'

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
7 months agoprivsep: allow __NR_clock_gettime32 syscall (#254)
Oleg Lyovin [Mon, 16 Oct 2023 16:59:00 +0000 (19:59 +0300)] 
privsep: allow __NR_clock_gettime32 syscall (#254)

musl libc doesn't have __NR_clock_gettime definition,
but has __NR_clock_gettime32. clock_gettime implementation
fallbacks to 32-bit version if 64-bit is not supported by the kernel.

Signed-off-by: Oleg Lyovin <ovlevin@sberdevices.ru>
7 months agoprivsep: allow __NR_mmap2 syscall (#253)
Oleg Lyovin [Thu, 12 Oct 2023 16:47:05 +0000 (19:47 +0300)] 
privsep: allow __NR_mmap2 syscall (#253)

The issue occured while compiled by musl toolchain:

    mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = ?
    +++ killed by SIGSYS +++

This patchs allows seccomp to make __NR_mmap2 syscall.

Signed-off-by: Oleg Lyovin <ovlevin@sberdevices.ru>
7 months agodhcpcd: freopen of stdin/stdout may change the fd
Roy Marples [Mon, 9 Oct 2023 13:03:37 +0000 (14:03 +0100)] 
dhcpcd: freopen of stdin/stdout may change the fd

So use dup2 instead.

7 months agoprivsep: Log script exit status.
Roy Marples [Mon, 9 Oct 2023 11:20:08 +0000 (12:20 +0100)] 
privsep: Log script exit status.

7 months agoRelease dhcpcd-10.0.3 v10.0.3
Roy Marples [Fri, 6 Oct 2023 08:27:53 +0000 (09:27 +0100)] 
Release dhcpcd-10.0.3

7 months agoDHCP6: Set all requested addrs as not stale when starting discovery
Roy Marples [Wed, 4 Oct 2023 16:38:08 +0000 (17:38 +0100)] 
DHCP6: Set all requested addrs as not stale when starting discovery

Hopefully fixes #249.

7 months agodoc: mention using `--with-openssl`
Roy Marples [Wed, 4 Oct 2023 12:47:57 +0000 (13:47 +0100)] 
doc: mention using `--with-openssl`

Fixes #225

7 months agoIPv6: Be explicit that lifetime zero means no longer a default router
Roy Marples [Wed, 4 Oct 2023 12:38:44 +0000 (13:38 +0100)] 
IPv6: Be explicit that lifetime zero means no longer a default router

Fixes #244

7 months agooptions: introduce the uri option as opposed to a string
Roy Marples [Wed, 4 Oct 2023 12:03:21 +0000 (13:03 +0100)] 
options: introduce the uri option as opposed to a string

Currently we don't attempt to validate a uri given, aside from
not allowing any space characters within.

If the option is `array uri` then the first two bytes are the
length of the uri in network order and the rest is a uri element.
The uri's are space separated for the variable because space is not
allowed within the uri.

This allows us to implement RFC 8572, Secure Zero Touch Provisioning.

7 months agooptions: andsf6 is DHCPv6, not DHCP
Roy Marples [Mon, 2 Oct 2023 10:01:39 +0000 (11:01 +0100)] 
options: andsf6 is DHCPv6, not DHCP

7 months agoCast a compile warning away
Roy Marples [Mon, 2 Oct 2023 09:54:36 +0000 (10:54 +0100)] 
Cast a compile warning away

7 months agocompat: use OpenSSL RAND_priv_bytes() for entropy (#248)
Tobias Heider [Fri, 29 Sep 2023 07:57:41 +0000 (09:57 +0200)] 
compat: use OpenSSL RAND_priv_bytes() for entropy (#248)

* compat: use OpenSSL RAND_priv_bytes() for entropy

Use OpenSSL random number generator to seed arc4random() if available,
if it fails fall back to /dev/urandom.

* tests: link eloop-bench against LDADD lib

arc4random might depend on libcrypto so we need to link it.

7 months agoSend correct amount of used buffer for prefix exclude option (#250)
Christian Tomahogh [Thu, 28 Sep 2023 23:04:37 +0000 (01:04 +0200)] 
Send correct amount of used buffer for prefix exclude option (#250)

The payload of the prefix exclude option was correctly created
but the amount of bytes to send in the DHCPv6 request was
always set to 0 which resulted in an invalid prefix exclude option

This patch fixes this behavior by calculating the correct amount
of bytes to send.

7 months agoGuard against handling many SIGTERM/SIGINT.
Roy Marples [Mon, 25 Sep 2023 09:34:12 +0000 (10:34 +0100)] 
Guard against handling many SIGTERM/SIGINT.

Privsep has a mini-eloop for reading data from other processes.
This mini-eloop processes signals as well so we can reap children.
During teardown we don't want to process SIGTERM or SIGINT again,
as that could trigger memory issues.

Hopefully fixes #247.

7 months agoUse a local variable instead of the optind (#86)
Petr Gotthard [Mon, 25 Sep 2023 09:00:27 +0000 (11:00 +0200)] 
Use a local variable instead of the optind (#86)

The optind get overwritten by reload_config(), so the reconf_reboot()
used a wrong argument count.

Signed-off-by: Petr Gotthard <petr.gotthard@centrum.cz>
7 months agoSupport libcrypto for hmac and sha256 (#223)
Tobias Heider [Mon, 25 Sep 2023 08:49:00 +0000 (10:49 +0200)] 
Support libcrypto for hmac and sha256 (#223)

* compat: Add OpenSSL libcrypto compatibility layer

Detect libcrypto in configure script.  Only fall back
to using libcrypto when /usr libs are allowed and no
other compatible implementation is available or when
--with-openssl is passed explicitly.
Make sure libcrypto and libmd are never linked at the
same time.

Add OpenSSL based SHA256 and HMAC compat shims in
compat/crypt_openssl. Depeding on version and build flags,
libcrypto ships with a compatible SHA256 API in
"openssl/sha.h".  OpenSSL 3 has deprecated the SHA API,
so if it is not detected we fall back to an EVP_DIGEST
based version.
Because the API might still be in use in OpenSSL internally,
the compatibility wrappers have a dhcpcd_ prefix to avoid
symbol conflicts.

* Add sha256 tests based on the existing hmac-md5 tests.

8 months agoFix some grammar in README.md
Ido Rosen [Tue, 12 Sep 2023 05:16:26 +0000 (22:16 -0700)] 
Fix some grammar in README.md

8 months agoClarify persistent wording to address confusion.
Ido Rosen [Sat, 9 Sep 2023 06:41:45 +0000 (23:41 -0700)] 
Clarify persistent wording to address confusion.

When persistent is not specified, dhcpcd de-configures the interface at exit.
However, the default dhcpcd.conf example provided enables the option.
See https://github.com/NetworkConfiguration/dhcpcd/discussions/140

8 months agoIgnore VSCode .vscode and macOS .DS_Store files
Ido Rosen [Sat, 9 Sep 2023 06:02:35 +0000 (23:02 -0700)] 
Ignore VSCode .vscode and macOS .DS_Store files

8 months agocompat: update arc4random() to newer chacha20 based version from OpenBSD (#227)
Tobias Heider [Mon, 4 Sep 2023 13:53:44 +0000 (15:53 +0200)] 
compat: update arc4random() to newer chacha20 based version from OpenBSD (#227)

* compat: update arc4random() to newer chacha20 based version from OpenBSD

* arc4random: keep fd after first call to arc4random

privsep + chroot doesn't allow us to reopen /dev/urandom in
an unpriviledged process so we open the fd once and then
hold onto it.

8 months agoci: execute tests after successful build (#243)
Tobias Heider [Mon, 4 Sep 2023 13:53:10 +0000 (15:53 +0200)] 
ci: execute tests after successful build (#243)

8 months agolinux: fix wireless roaming
Roy Marples [Fri, 21 Jul 2023 14:41:03 +0000 (15:41 +0100)] 
linux: fix wireless roaming

Fixes #228.

8 months agoprivsep: Fix a FD leak when processes exit
Roy Marples [Tue, 22 Aug 2023 12:59:23 +0000 (12:59 +0000)] 
privsep: Fix a FD leak when processes exit

Add commentary to say they are closed on receipt of SIGCHLD.

9 months agoprivsep: fix strlcpy overflow in psp_ifname (#239)
Tobias Heider [Tue, 15 Aug 2023 16:06:48 +0000 (18:06 +0200)] 
privsep: fix strlcpy overflow in psp_ifname (#239)

When running our Ubuntu tests with libc6 and strlcpy overflow checks
enabled we found that the wrong size is passed to strlcpy resulting
in a crash because of an overflow.

9 months agodhcpcd: Fix off-by-one overflow when read() writes full BUFSIZ (#236)
Tobias Heider [Sat, 12 Aug 2023 19:59:21 +0000 (21:59 +0200)] 
dhcpcd: Fix off-by-one overflow when read() writes full BUFSIZ (#236)

9 months agoAdd CI builds for Ubuntu, OpenBSD, FreeBSD and NetBSD (#229)
Tobias Heider [Fri, 4 Aug 2023 17:00:26 +0000 (19:00 +0200)] 
Add CI builds for Ubuntu, OpenBSD, FreeBSD and NetBSD (#229)

9 months agoDo not crash on dhcpcd test run (#231)
Petr Menšík [Fri, 4 Aug 2023 16:45:25 +0000 (18:45 +0200)] 
Do not crash on dhcpcd test run (#231)

Check if state->bpf is allocated before attempting to write there.

9 months agoFix --enable-secomp
Roy Marples [Thu, 20 Jul 2023 09:48:37 +0000 (10:48 +0100)] 
Fix --enable-secomp

9 months agoprivsep: Allow diabling of SECCOMP on Linux
Roy Marples [Thu, 20 Jul 2023 09:32:26 +0000 (10:32 +0100)] 
privsep: Allow diabling of SECCOMP on Linux

This allows a POSIX resource limited sandbox to be used at least
with privilege separation, which is better than just disabling
privilege separation entirely for when SECCOMP stops working due to
libc/kernel changes.

10 months agoRelease dhcpcd-10.0.2 v10.0.2
Roy Marples [Wed, 19 Jul 2023 13:34:04 +0000 (14:34 +0100)] 
Release dhcpcd-10.0.2

10 months agoFix compile warning with rb.c sync
Roy Marples [Wed, 19 Jul 2023 12:46:08 +0000 (13:46 +0100)] 
Fix compile warning with rb.c sync

10 months agocompat sync (#226)
Tobias Heider [Wed, 19 Jul 2023 12:29:48 +0000 (14:29 +0200)] 
compat sync (#226)

* compat: sync pidfile.c with netbsd v1.16

- fix typos in word "otherwise".
- s/sucess/success/ in comment.

* compat: sync rb.c with netbsd v1.16

- fix typos in word "successfully", mainly s/succesfully/successfully/.
- toolify

* compat: sync strlcpy.c with openbsd v1.16

- I am retiring my old email address;  replace it with my OpenBSD one.

* compat: sync arc4random_uniform.c with openbsd v1.3

10 months agolinux: consider IFF_LOWER_UP and !IFF_DORMANT for LINK_UP
Roy Marples [Mon, 17 Jul 2023 22:48:18 +0000 (23:48 +0100)] 
linux: consider IFF_LOWER_UP and !IFF_DORMANT for LINK_UP

10 months agoprivsep: Send only what we have put in the buffer to script env
Roy Marples [Wed, 19 Jul 2023 11:42:49 +0000 (12:42 +0100)] 
privsep: Send only what we have put in the buffer to script env

Rather then sending the whole buffer size.
If there is an error writing the last option, it may not be
NUL terminated correctly causing an assert.
Even so, we should not write the failed option to the environment
either as it would be a false positive for an empty option.

10 months agocommon: Allow hwaddr_ntoa to print an empty string
Roy Marples [Mon, 3 Jul 2023 12:11:05 +0000 (13:11 +0100)] 
common: Allow hwaddr_ntoa to print an empty string

This fixes #218 where we get a zero hardware address length in
an ARP packet or a length that overflows the string buffer.

10 months agocommon: Improve valid_domain and check correct return
Roy Marples [Mon, 3 Jul 2023 11:52:19 +0000 (12:52 +0100)] 
common: Improve valid_domain and check correct return

Improvement for #218.

10 months agoprivsep: Only unlink control sockets if we created them
Roy Marples [Sun, 2 Jul 2023 00:28:34 +0000 (01:28 +0100)] 
privsep: Only unlink control sockets if we created them

Fixes a segfault when trying to start dhcpcd as a non root user.
Closes #219 without an explicit test for being the root user.

10 months agorisc-v fix vendor error (#213)
Xea [Mon, 19 Jun 2023 16:20:29 +0000 (16:20 +0000)] 
risc-v fix vendor error (#213)

* added mproc for risc-v

* make mproc arches alphabetically sorted again

10 months agoAdditional DHCP options (#214)
Rob Gill [Mon, 19 Jun 2023 16:19:21 +0000 (02:19 +1000)] 
Additional DHCP options (#214)

DDoS Open Threat Signaling (DOTS) Agent Discovery, RFC8973
DHCP option 147,147; DHCPv6 option 141,142

Captive Portal, RFC8910
DHCP option 114; DHCVv6 option 104

update to attribution for MUD URL - RFC8520

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
10 months agoprivsep: Check if we have a root process before sending it stuff
Roy Marples [Mon, 19 Jun 2023 16:04:03 +0000 (17:04 +0100)] 
privsep: Check if we have a root process before sending it stuff

Fixes #210

11 months agoLinux: Improve learning IPv6 address flags
Roy Marples [Tue, 23 May 2023 21:14:57 +0000 (22:14 +0100)] 
Linux: Improve learning IPv6 address flags

Rather than matching addresses during netlink message processing,
extract the local, address and flag parts.
Once done, then match local and address to the address we are
looking for and if equal apply the flags.

Fixes #201 and maybe #149.

12 months agochore: Link to GitHub for the commit log and release announcements (#203)
frazar [Thu, 18 May 2023 21:09:53 +0000 (23:09 +0200)] 
chore: Link to GitHub for the commit log and release announcements (#203)

Fixes one of the two rotten links reported in #202

12 months agoLinux: fix disabling of kernel RA autoconf
Roy Marples [Thu, 18 May 2023 11:27:10 +0000 (12:27 +0100)] 
Linux: fix disabling of kernel RA autoconf

Well, that was a big whups leaving it turned on.
Thanks to Klaus Frank for the spot.
Fixes #176.

12 months agochore: Fix generation of dependency file
Roy Marples [Thu, 18 May 2023 11:15:49 +0000 (12:15 +0100)] 
chore: Fix generation of dependency file

12 months agobuild: Remove suffix prerequisite rules
Roy Marples [Thu, 18 May 2023 10:40:55 +0000 (11:40 +0100)] 
build: Remove suffix prerequisite rules

Just to silence GNU make.
This makes development slightly harder on BSDs, just have to
do a `make clean` when changing configuration options.

Fixes #197.

12 months agochore: Document building a bit more
Roy Marples [Thu, 18 May 2023 10:40:19 +0000 (11:40 +0100)] 
chore: Document building a bit more

And the fact that configure is not GNU.

12 months agooptions: Allow waitip to take space separated address families
Roy Marples [Thu, 18 May 2023 09:41:56 +0000 (10:41 +0100)] 
options: Allow waitip to take space separated address families

This is easier than writing confusing documentation to clarify.
Fixes #206.

12 months agodhcpcd: Fix waitip address family
Roy Marples [Wed, 17 May 2023 16:52:19 +0000 (17:52 +0100)] 
dhcpcd: Fix waitip address family

Minor fix for #206.

12 months agodhcpcd: support HANGUP of stderr cb
Roy Marples [Wed, 17 May 2023 16:39:27 +0000 (17:39 +0100)] 
dhcpcd: support HANGUP of stderr cb

12 months agocontrol: Ingore control not connected errors too
Roy Marples [Wed, 17 May 2023 09:52:23 +0000 (10:52 +0100)] 
control: Ingore control not connected errors too

For FreeBSD.
Another one for #205.

12 months agocontrol: ignore EPIPE errors on write
Roy Marples [Wed, 17 May 2023 09:45:34 +0000 (09:45 +0000)] 
control: ignore EPIPE errors on write

Other end has shutdown.

12 months agocontrol: deal with hangup better
Roy Marples [Wed, 17 May 2023 02:08:45 +0000 (03:08 +0100)] 
control: deal with hangup better

Maybe fix #205

12 months agoprivsep: Allow zero length messages through
Roy Marples [Tue, 16 May 2023 16:16:26 +0000 (17:16 +0100)] 
privsep: Allow zero length messages through

They should be handled gracefully without privsep anyway.
Fix for #179.

12 months agoDHCP: Don't enforce the message came port 67
Roy Marples [Mon, 8 May 2023 14:52:11 +0000 (15:52 +0100)] 
DHCP: Don't enforce the message came port 67

RFC2131 and updates make no mention of what the source port
should or must be.

Update for #179.

12 months agoBSD: Fix non INET6 builds
J. Hannken-Illjes [Thu, 27 Apr 2023 11:43:33 +0000 (12:43 +0100)] 
BSD: Fix non INET6 builds

12 months agoOpenBSD: Ensure if_afreq is correct initialised.
Roy Marples [Wed, 26 Apr 2023 13:29:46 +0000 (14:29 +0100)] 
OpenBSD: Ensure if_afreq is correct initialised.

12 months agoBSD: When we get RTM_NEWADDR the interface must have IFF_UP.
Roy Marples [Wed, 26 Apr 2023 13:15:07 +0000 (14:15 +0100)] 
BSD: When we get RTM_NEWADDR the interface must have IFF_UP.

This is apparently historic behaviour.
It's not always mirrored in RTM_IFINFO either so we need to
replicate the behaviour if we had got it earlier.

This fixes dhcpcd requiring at least something to set the interface
up before starting on OpenBSD.
Other BSD are less impacted because it's a lot harder to get into
this state as we have more control over setting the IPv6 LL address.

12 months agoRevert "OpenBSD: When attaching INET6 set IFF_UP"
Roy Marples [Wed, 26 Apr 2023 13:01:07 +0000 (14:01 +0100)] 
Revert "OpenBSD: When attaching INET6 set IFF_UP"

This reverts commit 985aa759da7b8b1c47d5e90c5a6e835ec17855e8.

12 months agoOpenBSD: When attaching INET6 set IFF_UP
Roy Marples [Wed, 26 Apr 2023 10:52:17 +0000 (11:52 +0100)] 
OpenBSD: When attaching INET6 set IFF_UP

Because some, if not all, OpenBSD interface drivers do this.
https://github.com/openbsd/src/blob/master/sys/dev/pv/if_vio.c#L856

With this hack, dhcpcd can now operate at boot time without any
manual interface setup.

12 months agoOpenBSD: add RTM_DESYNC to route(4) filter.
Roy Marples [Tue, 25 Apr 2023 13:32:40 +0000 (14:32 +0100)] 
OpenBSD: add RTM_DESYNC to route(4) filter.

12 months agoOpenBSD: fix unused variables compile warning
Roy Marples [Tue, 25 Apr 2023 10:06:29 +0000 (11:06 +0100)] 
OpenBSD: fix unused variables compile warning

12 months agodhcp6: log debug inform requests when the prior action failed
Roy Marples [Mon, 24 Apr 2023 10:53:54 +0000 (11:53 +0100)] 
dhcp6: log debug inform requests when the prior action failed

This should reduce log spam without debug for badly configured networks.
Fixes #80.

12 months agoeloop: define __arraycount if not defined by the OS
Roy Marples [Sun, 23 Apr 2023 07:54:23 +0000 (08:54 +0100)] 
eloop: define __arraycount if not defined by the OS

12 months agochore: stat isn't portable, wc is
Roy Marples [Fri, 21 Apr 2023 13:58:25 +0000 (14:58 +0100)] 
chore: stat isn't portable, wc is

12 months agochore: include filesize in the distinfo
Roy Marples [Fri, 21 Apr 2023 10:08:32 +0000 (11:08 +0100)] 
chore: include filesize in the distinfo

12 months agochore: Makefile parts are more copy and pastable
Roy Marples [Thu, 20 Apr 2023 20:14:02 +0000 (21:14 +0100)] 
chore: Makefile parts are more copy and pastable

12 months agoRelease dhcpcd-10.0.1 v10.0.1
Roy Marples [Thu, 20 Apr 2023 11:16:36 +0000 (12:16 +0100)] 
Release dhcpcd-10.0.1

12 months agochore: fix release
Roy Marples [Thu, 20 Apr 2023 11:12:14 +0000 (12:12 +0100)] 
chore: fix release

12 months agochore: update build system to publish signed github releases
Roy Marples [Thu, 20 Apr 2023 11:00:32 +0000 (12:00 +0100)] 
chore: update build system to publish signed github releases

We rely on the GitHub CLI tools to do this.
We publish the compressed source tarball and a detached PGP
signature for it.
We add the SHA256 checksum of the tarball as a note on the release.
Automatic links to the changes are also given.

13 months agobpf: Always open /dev/bpf directly
Roy Marples [Thu, 13 Apr 2023 16:43:11 +0000 (17:43 +0100)] 
bpf: Always open /dev/bpf directly

Ignore _PATH_BPF as that's really a NetBSDism.
If /dev/bpf throws a wobbly then try /dev/bpfN for older kernels.

This allows cloning BPF on more BSD systems.

13 months agoRelease dhcpcd-10.0.0 v10.0.0
Roy Marples [Thu, 13 Apr 2023 10:59:00 +0000 (11:59 +0100)] 
Release dhcpcd-10.0.0

13 months agoFreeBSD no longer needs static linking
Roy Marples [Tue, 11 Apr 2023 18:25:03 +0000 (19:25 +0100)] 
FreeBSD no longer needs static linking

14 months agodhcpcd doesn't need to be statically linked on DragonFly
Roy Marples [Fri, 17 Mar 2023 11:11:39 +0000 (11:11 +0000)] 
dhcpcd doesn't need to be statically linked on DragonFly

14 months agoMerge remote-tracking branch 'github/privsep-musl'
Roy Marples [Thu, 16 Mar 2023 12:04:29 +0000 (12:04 +0000)] 
Merge remote-tracking branch 'github/privsep-musl'

14 months agoMerge remote-tracking branch 'github/dhcp6-ntp'
Roy Marples [Thu, 16 Mar 2023 12:02:33 +0000 (12:02 +0000)] 
Merge remote-tracking branch 'github/dhcp6-ntp'

14 months agoprivsep: Allow ioctl TIOCGWINSZ for dumping leases on musl
Roy Marples [Fri, 24 Feb 2023 10:17:27 +0000 (10:17 +0000)] 
privsep: Allow ioctl TIOCGWINSZ for dumping leases on musl

Fixes #186.