]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
22 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.

22 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

22 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

22 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

22 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.

22 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)

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

Fixes #228.

23 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.

23 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.

23 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)

23 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)

23 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.

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

2 years 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.

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years 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>
2 years 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

2 years 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.

2 years 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

2 years 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.

2 years 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

2 years 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.

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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.

2 years 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.

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

2 years 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.

2 years 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.

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years 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.

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

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

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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

2 years 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'

2 years 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'

2 years 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.

2 years agocontrol: Improve error handling if reading a control message fails
Roy Marples [Fri, 24 Feb 2023 10:16:26 +0000 (10:16 +0000)] 
control: Improve error handling if reading a control message fails

2 years agoRemove debug
Roy Marples [Thu, 23 Feb 2023 00:27:55 +0000 (00:27 +0000)] 
Remove debug

2 years agoprivsep: Allow madvise for musl.
Roy Marples [Thu, 23 Feb 2023 00:21:14 +0000 (00:21 +0000)] 
privsep: Allow madvise for musl.

Fixes #186.

2 years agoprivsep-linux: fix SECCOMP_AUDIT_ARCH missing ppc64le (#181)
CHEN Xiangyu [Thu, 9 Feb 2023 10:41:52 +0000 (18:41 +0800)] 
privsep-linux: fix SECCOMP_AUDIT_ARCH missing ppc64le (#181)

when dhcpcd running on ppc64le platform, it would be killed by SIGSYS.

Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
2 years agoDHCP6: Request OPTION_NTP_SERVER to mirror DHCP
Roy Marples [Tue, 7 Feb 2023 18:25:45 +0000 (18:25 +0000)] 
DHCP6: Request OPTION_NTP_SERVER to mirror DHCP

RFC 5908 deprecates OPTION_SNTP_SERVERS.
However we can support both at the same time as our scripts
will uniqify the results if there are stupidly any duplicates.

Fixes #183.

2 years agooptions: Fix prior
Roy Marples [Tue, 7 Feb 2023 17:02:29 +0000 (17:02 +0000)] 
options: Fix prior

For #184.

2 years agooptions: Match exact string for environment changes
Roy Marples [Tue, 7 Feb 2023 16:39:27 +0000 (16:39 +0000)] 
options: Match exact string for environment changes

So that domain_name doesn't overwrite domain_name_servers.
Fixes #184.

2 years agoprivsep: Don't try to unlink the pidfile in test mode
Roy Marples [Tue, 7 Feb 2023 16:39:00 +0000 (16:39 +0000)] 
privsep: Don't try to unlink the pidfile in test mode

2 years agoFix incorrect CTASSERT in ND_OPT_DNSSL (#178)
Klaus Frank [Thu, 26 Jan 2023 10:23:55 +0000 (10:23 +0000)] 
Fix incorrect CTASSERT in ND_OPT_DNSSL (#178)

Fix incorrect CTASSERT in ND_OPT_DNSSL

2 years agoprivsep: Unload dev early if we are not the root process
Roy Marples [Mon, 9 Jan 2023 16:35:37 +0000 (16:35 +0000)] 
privsep: Unload dev early if we are not the root process

No point listening to it and newer udev throws an error
trying to unload when chrooted so this fixes that.

2 years agocompat: Remove literal suffix from md5.h
Roy Marples [Mon, 9 Jan 2023 11:16:13 +0000 (11:16 +0000)] 
compat: Remove literal suffix from md5.h

Modern compilers no longer complain without it, but do with it.

2 years agolinux: clean some more compiler warnings
Roy Marples [Mon, 9 Jan 2023 11:15:13 +0000 (11:15 +0000)] 
linux: clean some more compiler warnings

gcc-12 and clang-14 no longer emit any errors

2 years agolinux: Fix compile warning using clang
Roy Marples [Mon, 9 Jan 2023 10:09:45 +0000 (10:09 +0000)] 
linux: Fix compile warning using clang

2 years agoconfigure: Ensure that we use the return of the functions we test
Roy Marples [Sun, 8 Jan 2023 22:10:21 +0000 (22:10 +0000)] 
configure: Ensure that we use the return of the functions we test

As newer compiler defaults warn if they are not used.
Should fix #163.

2 years agoprivsep: Try sending error if we cannot send the message.
Roy Marples [Fri, 6 Jan 2023 11:14:45 +0000 (11:14 +0000)] 
privsep: Try sending error if we cannot send the message.

There is an error sending a reply from an INET6 sysctl RT dump
on FreeBSD-14 using the dhcpcd-9 branch.
It seems to be related to capsicum and doesn't happen on FreeBSD-13.
We should handle the error gracefully and allow dhcpcd to try to
contuinue regardless.

2 years agodhcp: Remove bootp arg from rt 3442 decoding
Roy Marples [Thu, 5 Jan 2023 11:17:12 +0000 (11:17 +0000)] 
dhcp: Remove bootp arg from rt 3442 decoding

Fixes a compile warning. Addendum to #161.

2 years agoWelcome to 2023.
Roy Marples [Thu, 5 Jan 2023 10:51:32 +0000 (10:51 +0000)] 
Welcome to 2023.

2 years agodhcp: Fix classless link local static routes (#161)
xvuko [Thu, 5 Jan 2023 09:02:52 +0000 (10:02 +0100)] 
dhcp: Fix classless link local static routes (#161)

Detecting host routes based on address comparison is not needed in
classless routes as /32 mask can be explicitly used. This detecting
mechanism did cause issues when gateway was set to 0.0.0.0 (link local
routes).

2 years agooptions: Fix parsing of strings.
Roy Marples [Fri, 23 Dec 2022 17:35:29 +0000 (17:35 +0000)] 
options: Fix parsing of strings.

If we are not passed a buffer we should blindly return the
result of trying to parse it has as a hex string - it will be zero.
Fixes 133.

2 years agohooks: Use --no-block for systemd
Roy Marples [Fri, 23 Dec 2022 16:42:23 +0000 (16:42 +0000)] 
hooks: Use --no-block for systemd

As we really don't want to block dhcpcd if systemd does.
Fixes #141.

2 years agoif: Again fix prior on NetBSD
Roy Marples [Fri, 23 Dec 2022 16:15:58 +0000 (16:15 +0000)] 
if: Again fix prior on NetBSD

2 years agoif: Fix issue with prior with privsep enabled
Roy Marples [Fri, 23 Dec 2022 16:13:09 +0000 (16:13 +0000)] 
if: Fix issue with prior with privsep enabled

Addition to #157.

2 years agoDHCP: Set option buffer length to 0 when freeing
Roy Marples [Fri, 23 Dec 2022 14:24:59 +0000 (14:24 +0000)] 
DHCP: Set option buffer length to 0 when freeing

As we test length of buffer when reallocating.
Fixes #156.

2 years agoif: Add if_freeifaddrs so we can free ifaddrs on all code paths
Roy Marples [Fri, 23 Dec 2022 13:54:22 +0000 (13:54 +0000)] 
if: Add if_freeifaddrs so we can free ifaddrs on all code paths

Fixes #157.

2 years agoarp: ignore invalid ARP probes according to RFC5227 (#145)
Laszlo Toth [Fri, 23 Dec 2022 13:31:43 +0000 (08:31 -0500)] 
arp: ignore invalid ARP probes according to RFC5227 (#145)

Some network devices can send probes where the source address in the frame
does not match the sender in the ARP request, due to firmware bugs or
crafted packets.
Without verification this can cause to fail the defense, so we lose the
address, then request a new one. This might lead to the DHCP address pool
being exhausted and all sorts of problems like frequent IP changes.

A real life example is that some Cisco devices can send ARP probes in bursts,
where the frame's source address is clearly invalid, so hosts running dhcpcd
release addresses frequently, e.g., Raspberry Pis.
Example output:
"invalid ARP probe, sender hw address mismatch (00:be:75:xx:xx:xx, 00:00:00:yy:yy:yy)"

RFC5227, Section 1.1 describes that the two addresses must match in case
of ARP probes, so add the extra check and log a warning if we receive an
invalid packet like that.

Signed-off-by: Laszlo Toth <laszlth@gmail.com>
2 years agoconfigure: --prefix also sets $prefix for compat with autoconf
Roy Marples [Mon, 17 Oct 2022 13:30:03 +0000 (14:30 +0100)] 
configure: --prefix also sets $prefix for compat with autoconf

Fixes #139

2 years agoCompilation fix on linux platform with clang (#130)
Alexey Kasyanchuk [Tue, 11 Oct 2022 16:53:02 +0000 (19:53 +0300)] 
Compilation fix on linux platform with clang (#130)

2 years agoprivsep: Improve the race to exit
Roy Marples [Tue, 6 Sep 2022 08:18:08 +0000 (09:18 +0100)] 
privsep: Improve the race to exit

Each process should now cleanly wait for child processes to exit.
They should only exit when no children left.

There is still no way to cleanly log the privilged process exiting
as well as the manager process as the manager needs the
privilged process to log.

Now, at least, dhcpcd should alway say it's exited.

2 years agodhcpcd: Remove last nanosleep
Roy Marples [Mon, 5 Sep 2022 20:37:32 +0000 (21:37 +0100)] 
dhcpcd: Remove last nanosleep

Fixes #128.

2 years agodhcpcd: Use eloop timeout to wait for pidfile removal
Roy Marples [Mon, 5 Sep 2022 12:20:50 +0000 (13:20 +0100)] 
dhcpcd: Use eloop timeout to wait for pidfile removal

As well as removing not enabled code to wait a bit before
removing the IP address when sending a DHCP RELEASE message.

This means that we no longer need to allow nanosleep in SECCOMP.

Hopefully fixes #127.

2 years agoprivsep: Don't find processes we just asked to stop
Roy Marples [Fri, 2 Sep 2022 11:54:25 +0000 (12:54 +0100)] 
privsep: Don't find processes we just asked to stop

We could rebind a lease, get a NAK and enter DISCOVER.
We need to restart the BPF in the middle as the BPF filter could
change.

As such, add a started flag to each privsep process and when
searching for a process by id only find started ones.
If we ask them to stop then the started flag is removed.

Fixes errors about writing to stopping processes an unknown
processes exiting.

2 years agoFix prior when asking dhcpcd to exit and it's not running
Roy Marples [Fri, 2 Sep 2022 11:02:25 +0000 (12:02 +0100)] 
Fix prior when asking dhcpcd to exit and it's not running

2 years agodhcpcd: Fix sending interface specific commands to manager process
Roy Marples [Thu, 1 Sep 2022 19:48:40 +0000 (20:48 +0100)] 
dhcpcd: Fix sending interface specific commands to manager process

Seems to have been broken for a while .... good to have this fixed.

2 years agoNormalise `dhcpcd is not running` message
Roy Marples [Wed, 31 Aug 2022 19:04:11 +0000 (20:04 +0100)] 
Normalise `dhcpcd is not running`  message

2 years agoinet6: Tokenised IPv6 Identifiers fix man page
Roy Marples [Wed, 31 Aug 2022 15:58:28 +0000 (16:58 +0100)] 
inet6: Tokenised IPv6 Identifiers fix man page

One typo, again for #101.

2 years agoinet6: Fix Tokenised IPv6 Identifiers
Roy Marples [Wed, 31 Aug 2022 11:17:53 +0000 (12:17 +0100)] 
inet6: Fix Tokenised IPv6 Identifiers

Another one for #101.

2 years agoBump dates for prior
Roy Marples [Wed, 31 Aug 2022 08:21:09 +0000 (09:21 +0100)] 
Bump dates for prior

2 years agoGrammar improvements and typo fixes to README and manpages
Pau Amma [Wed, 31 Aug 2022 07:45:24 +0000 (15:45 +0800)] 
Grammar improvements and typo fixes to README and manpages

2 years agodhcp: allow static options to be removed by not setting a value
Roy Marples [Tue, 30 Aug 2022 20:32:04 +0000 (21:32 +0100)] 
dhcp: allow static options to be removed by not setting a value

This allows this config:

interface eth0
arping 1.2.3.4
static ip_address=5.6.7.8/24

profile 1.2.3.4
# Allow DHCP
static ip_address=