]>
git.ipfire.org Git - thirdparty/dhcpcd.git/log
Stuart Henderson [Fri, 3 Apr 2020 12:23:49 +0000 (12:23 +0000)]
use TEMP_PREFERRED/VALID_LIFETIME for OpenBSD
Shortly after dhcpcd started using these constants, they were dropped from OpenBSD kernel headers as they're only used by rad(8). Switch to dhcpcd's own constants instead, fixing build on recent -current.
Roy Marples [Thu, 2 Apr 2020 19:54:19 +0000 (19:54 +0000)]
Fix build without INET or INET6
Roy Marples [Thu, 2 Apr 2020 12:14:09 +0000 (13:14 +0100)]
Release dhcpcd-9.0.0
Roy Marples [Wed, 1 Apr 2020 15:12:37 +0000 (16:12 +0100)]
Note that setting pltime to zero for stale addresses isn't RFC compliant
But also note we need to do this to ensure the kernel tries to use
better addresses.
Roy Marples [Wed, 1 Apr 2020 12:22:15 +0000 (13:22 +0100)]
resolv.conf: Uniquify contents
We might have >1 router that broadcasts the same DNS information.
While resolvconf(8) can easily take care of uniqifying the data,
not all systems have this nice tool so do the job here as well.
Roy Marples [Wed, 1 Apr 2020 11:19:47 +0000 (12:19 +0100)]
ND: Improve stale detection for >1 router
Roy Marples [Wed, 1 Apr 2020 08:16:47 +0000 (09:16 +0100)]
ND: Check matching iface to make stale and add commentary
Roy Marples [Tue, 31 Mar 2020 21:33:25 +0000 (22:33 +0100)]
ND: If a secondary router adds the same prefix, use it's address
With slaac private, it will generate a new address which would
be wrong.
Roy Marples [Tue, 31 Mar 2020 21:00:52 +0000 (22:00 +0100)]
ND: Only deprecate prefixes when all stale
Roy Marples [Tue, 31 Mar 2020 19:21:58 +0000 (20:21 +0100)]
dhcpcd: disable address sanitization by default
As recent production kernels ship with ASLR by default which
stops dhcpcd running dead when this is enabled.
We dont want to break a systems boot, so force it via configure.
Roy Marples [Tue, 31 Mar 2020 18:45:17 +0000 (19:45 +0100)]
linux: the default hostname is (none)
It's blank for the BSD's.
Respect this when relinquishing the hostname.
Roy Marples [Tue, 31 Mar 2020 17:23:05 +0000 (18:23 +0100)]
hostname: Default to blank instead of localhost
No kernel sets a default value of localhost.
Roy Marples [Tue, 31 Mar 2020 10:30:30 +0000 (11:30 +0100)]
Don't install /var/db/dhcpcd in the Makefile
dhcpcd will create it in the right place by default.
Roy Marples [Mon, 30 Mar 2020 16:12:26 +0000 (17:12 +0100)]
privsep: Refuse chroot if privsep users home dir is /var/empty
As we should not be filling it.
This means we don't mess up a stock install where the pkg admin
hasn't setup privsep correctly.
Roy Marples [Mon, 30 Mar 2020 15:56:12 +0000 (16:56 +0100)]
BSD: Don't warn if the OS does not support miss filtering.
The compile warning is enough.
Roy Marples [Mon, 30 Mar 2020 15:36:30 +0000 (16:36 +0100)]
FreeBSD: Remove unused compile warning
The actual warning about the lack of filtering is enough.
Roy Marples [Sat, 28 Mar 2020 17:52:52 +0000 (17:52 +0000)]
script: Start RA addresses from 1, not 0.
Roy Marples [Sat, 28 Mar 2020 17:01:49 +0000 (17:01 +0000)]
dhcpcd: dump lease on the unpriviledged socket
Roy Marples [Sat, 28 Mar 2020 16:05:28 +0000 (16:05 +0000)]
Fix compile on Linux
Roy Marples [Fri, 27 Mar 2020 22:07:14 +0000 (22:07 +0000)]
dumplease: Separate ifaces
Roy Marples [Fri, 27 Mar 2020 16:14:48 +0000 (16:14 +0000)]
dhcpcd: dumping lease uses control socket to get the lease
Thanks to privsep it's hard to know where the lease is now stored.
As such, the only true location is from the running dhcpcd process.
The ability to read a raw lease from stdin has been dropped.
Roy Marples [Fri, 27 Mar 2020 16:04:35 +0000 (16:04 +0000)]
privsep: Don't close output streams if debugging or testing
Roy Marples [Fri, 27 Mar 2020 16:04:10 +0000 (16:04 +0000)]
options: move warning
Roy Marples [Tue, 17 Mar 2020 07:57:03 +0000 (07:57 +0000)]
dhcpcd: Improve error when interface does not exist vs invalid config
Roy Marples [Sat, 14 Mar 2020 16:02:32 +0000 (16:02 +0000)]
privsep: Don't create DB directory in the real root as well.
Roy Marples [Sat, 14 Mar 2020 10:40:22 +0000 (10:40 +0000)]
BSD: use satosin6 rather than a direct cast
Roy Marples [Wed, 11 Mar 2020 01:11:41 +0000 (01:11 +0000)]
RA: Prefer older routers at the preference
Roy Marples [Tue, 10 Mar 2020 12:19:03 +0000 (12:19 +0000)]
IPv6ND: Mark stale addresses/prefixes with a pltime of zero.
This mirrors DHCPv6 behaviour.
Roy Marples [Tue, 10 Mar 2020 12:17:58 +0000 (12:17 +0000)]
IPv6ND: ap -> ia rototill
Roy Marples [Mon, 9 Mar 2020 10:34:14 +0000 (10:34 +0000)]
Remove empty brace from prior
Roy Marples [Sun, 8 Mar 2020 21:37:50 +0000 (21:37 +0000)]
options: optimise token storage by reducing free calls
Also avoid a potential memory issue if the malloc call to save the
key fails.
Roy Marples [Wed, 4 Mar 2020 15:07:24 +0000 (15:07 +0000)]
DHCP: Move the max frame length check
Roy Marples [Sat, 22 Feb 2020 17:07:38 +0000 (17:07 +0000)]
DHCP: Appease LGTM finding unlikely user overflow from overself
Only in privsep.
Roy Marples [Sat, 22 Feb 2020 16:42:31 +0000 (16:42 +0000)]
dhcpcd: don't report forked to background in quiet mode
Roy Marples [Wed, 19 Feb 2020 18:14:28 +0000 (18:14 +0000)]
DHCP: Add support for the Microsoft User Class option
Along with advice on how to set correctly the Vendor Class ID.
Also note this is not RFC compliant.
Roy Marples [Wed, 19 Feb 2020 11:15:49 +0000 (11:15 +0000)]
options: Define parse_nstring and use it
Makes the code easier to read.
While here, use sizeof rather than size constants to make it
more clear of the length of the property we're copying to.
Roy Marples [Sun, 16 Feb 2020 13:32:54 +0000 (13:32 +0000)]
DHCP6: Fix SMALL build
Roy Marples [Sun, 16 Feb 2020 13:32:13 +0000 (13:32 +0000)]
privsep: Fix build without ARP support
Roy Marples [Sun, 16 Feb 2020 09:38:57 +0000 (09:38 +0000)]
Revert "dhcp: Cast away a compile warning"
This reverts commit
ccf3a5e9fe4ea8f63cfcdb27f96b02ec2cc8ff70 .
This has been determined to be a gcc bug and will be worked
around another way in the build system.
Roy Marples [Sat, 15 Feb 2020 01:50:31 +0000 (01:50 +0000)]
if: Decode vlid from the interface name
This just clarifies the former fix
Roy Marples [Sat, 15 Feb 2020 01:29:13 +0000 (01:29 +0000)]
if: . is part of the interface name, not an alias
Roy Marples [Fri, 14 Feb 2020 06:47:40 +0000 (06:47 +0000)]
net: If if_learnaddrs fails unexpectedly, log address and interface
This will greatly aid debugging.
Roy Marples [Tue, 11 Feb 2020 11:20:58 +0000 (11:20 +0000)]
Be pedantic and move syslog.h into the right place
Sergey Nikiforov [Tue, 11 Feb 2020 11:07:13 +0000 (11:07 +0000)]
logerr: Use macros to call log functions
This allows downstream implementions to inject their own data
into the log message and/or supply new logging targets whilst
preserving macros such as __FILE__ and __LINE__.
Roy Marples [Mon, 10 Feb 2020 22:08:26 +0000 (22:08 +0000)]
privsep: Don't run the CHROOT hook if we can't init privsep.
Roy Marples [Mon, 10 Feb 2020 14:35:08 +0000 (14:35 +0000)]
another typo
Roy Marples [Mon, 10 Feb 2020 13:26:30 +0000 (13:26 +0000)]
spelling: Correct both privilege and separation
Found by Arfrever.
Roy Marples [Sun, 9 Feb 2020 18:54:29 +0000 (18:54 +0000)]
inet6: guard getting RA routers if inet6 not initialised
Now that we get inet6 routes even when only building inet routes
we need to guard as the RA routers collection could be NULL.
Roy Marples [Sun, 9 Feb 2020 16:57:27 +0000 (16:57 +0000)]
BSD: Fix processing RTM_MISS for non NetBSD BSDs
Roy Marples [Sat, 8 Feb 2020 17:29:03 +0000 (17:29 +0000)]
BSD: Add support for RO_MISSFILTER route(4) socket option
This allows dhcpcd to only listen for RTM_MISS generated by
default routers dhcpcd *could* install so if one becomes
unreachable we can pick another.
Roy Marples [Fri, 7 Feb 2020 20:56:11 +0000 (20:56 +0000)]
DragonFlyBSD: Fix compile
Roy Marples [Fri, 7 Feb 2020 15:04:25 +0000 (15:04 +0000)]
dhcpcd: randomise hardware address on start if no carrier
For more anonymity.
fox [Fri, 7 Feb 2020 14:13:59 +0000 (14:13 +0000)]
dhcp: Cast away a compile warning
Roy Marples [Fri, 7 Feb 2020 13:16:06 +0000 (13:16 +0000)]
Linux: mask the NETLINK_GET_STRICT_CHK: Protocol not available error
Just to appease Arch LTS users (packages are built with newer
headers than what kernel supports).
Roy Marples [Fri, 7 Feb 2020 12:52:51 +0000 (12:52 +0000)]
options: Improve AF_INET6 address parsing and logging
Roy Marples [Fri, 7 Feb 2020 12:18:46 +0000 (12:18 +0000)]
inet6: Calculate the prefix in the canonical form
Rather than being clever and getting it wrong.
Roy Marples [Thu, 6 Feb 2020 15:08:21 +0000 (15:08 +0000)]
Add an extra fallthrough to prior
Roy Marples [Thu, 6 Feb 2020 14:59:24 +0000 (14:59 +0000)]
inet6: Swap between DISCOVER and INFORM better
Most of the time this will be dictated by the RA, but let our
config decide as well.
Roy Marples [Thu, 6 Feb 2020 12:58:43 +0000 (12:58 +0000)]
DHCP6: Clean up old lease when we fail to confirm/rebind, etc
Also removed the TIMEOUT states which makes things easier to read.
Roy Marples [Thu, 6 Feb 2020 12:54:11 +0000 (12:54 +0000)]
inet6: Ensure expired routers are cleared after a carrier loss
When we lose carrier, mark all RAs as willexpire and add
the timeout to expire to it's own queue.
On receipt of a matching RA, clear the willexpire flag.
When the above timeout occours, set doexpire on all
RA's with withexpire and then call the general expirera function.
This is needed because expirera can be called at any point.
Roy Marples [Thu, 6 Feb 2020 12:50:31 +0000 (12:50 +0000)]
eloop: define eloop queue numbers in common.h
Allows for easier maintainance.
Petr Gotthard [Wed, 5 Feb 2020 15:35:44 +0000 (15:35 +0000)]
compat: Fix a typo in pidfile when O_CLOEXEC is not defined
While here, include fcntl.h in if.c for older environments.
Roy Marples [Wed, 5 Feb 2020 15:10:44 +0000 (15:10 +0000)]
DHCP: Fix receiving BPF from privsep.
Roy Marples [Wed, 5 Feb 2020 14:54:49 +0000 (14:54 +0000)]
ARP: Only copy out frame header if we have it.
Frameless does exist.
Roy Marples [Wed, 5 Feb 2020 14:38:04 +0000 (14:38 +0000)]
ARP: Recalculate ARP buffer taking into account max frame length
Roy Marples [Wed, 5 Feb 2020 14:05:51 +0000 (14:05 +0000)]
DHCP: Support jumbo frames
Also important as we now need to store the frame header in the
initial buffer.
Roy Marples [Wed, 5 Feb 2020 13:29:45 +0000 (13:29 +0000)]
BPF: Return the frame header with the data
For DHCP, we then just skip over the frame header.
For ARP, we extract the frame source and destination addresses
so we can log the source in the event of a conflict.
This is important as a user has found a router which sets the ARP
source and destination hardware addresses to all zeros but unicasts
the ARP straight to our hardware address.
https://serverfault.com/questions/297425/ip-address-conflict-with-mac-address-
000000000000
https://discussions.flightaware.com/t/piaware-wont-reconnect-to-wifi-network-if-it-drops-off/59789
Roy Marples [Tue, 4 Feb 2020 16:30:29 +0000 (16:30 +0000)]
BSD: ignore XEN DOM0 virtual interface xvif
Roy Marples [Tue, 4 Feb 2020 16:29:07 +0000 (16:29 +0000)]
if: decode XEN vif1.2 and xvif1i2 as vif1:2
Roy Marples [Tue, 4 Feb 2020 15:44:49 +0000 (15:44 +0000)]
BSD: When applying RA base information, get info without privsep
privsep cannot current pass it back ..... duh
Roy Marples [Tue, 4 Feb 2020 15:39:50 +0000 (15:39 +0000)]
Revert "BSD: When applying RA base information, ensure flags are correct"
This reverts commit
8437a9be7c91dc24915d1fbc0cbe59618ebb1bbe .
Roy Marples [Tue, 4 Feb 2020 15:21:40 +0000 (15:21 +0000)]
BSD: When applying RA base information, ensure flags are correct
For some resaon, under privsep only, SIOCGIFINFO_IN6 returns 0
in flags even though the kernel seems to set it correctly.
SIOCSIFINFO_IN6 *will* overwrite flags regardless, so ensure
it has the correct value for dhcpcd.
Roy Marples [Tue, 4 Feb 2020 15:01:18 +0000 (15:01 +0000)]
Style
Roy Marples [Tue, 4 Feb 2020 02:38:35 +0000 (02:38 +0000)]
eloop: cast away a compile warning
Roy Marples [Fri, 31 Jan 2020 11:04:27 +0000 (11:04 +0000)]
ARP: add a comment to note ethernet padding upto 60 bytes.
Roy Marples [Wed, 29 Jan 2020 17:06:34 +0000 (17:06 +0000)]
BSD: Don't log an error failing to get inet6 adress flags
When the interface departs and we're validating route messages.
This mirrors inet.
Roy Marples [Mon, 27 Jan 2020 21:47:24 +0000 (21:47 +0000)]
Mention chroot
Christos Zoulas [Mon, 27 Jan 2020 12:56:04 +0000 (12:56 +0000)]
IPv4LL: A state might not always exist when running the script.
For example, we deleted existing IPv4LL addresses that dhcpcd
doesn't directly control when we obtained a DHCP lease.
Roy Marples [Sun, 26 Jan 2020 16:44:40 +0000 (16:44 +0000)]
DHCP: redirect message to other interfaces if received for inactive
This is unlikely but possible if you have a manual subnet route
via another interface you normally receive a DHCP address inside
this subnet.
Saves spamming the log that we received for an inactive interface
as well.
Roy Marples [Sun, 26 Jan 2020 15:58:51 +0000 (15:58 +0000)]
dhcpcd: report how large a route rocket receive buffer size we set
Roy Marples [Sun, 26 Jan 2020 15:46:41 +0000 (15:46 +0000)]
dhcpcd: When route socket overflows, report how large it is.
Of course Linux likes to double it, so cater for this.
Roy Marples [Sun, 26 Jan 2020 15:46:16 +0000 (15:46 +0000)]
if: Don't use a variable length buffer
Otherwise SSP complains.
Roy Marples [Sat, 25 Jan 2020 13:27:36 +0000 (13:27 +0000)]
dhcpcd: For anonymous do not bring interface up if was down
We need to bring the interface down on carrier loss to change the
hardware address, but we should only bring it up again if it was
up previously.
After all it's really an administrative flag.
Roy Marples [Wed, 22 Jan 2020 19:25:14 +0000 (19:25 +0000)]
BSD: Fix INET flags on RTM_NEWADDR messages.
Roy Marples [Wed, 22 Jan 2020 17:15:30 +0000 (17:15 +0000)]
DHCP: Defend already configured static addresses
Roy Marples [Wed, 22 Jan 2020 16:32:09 +0000 (16:32 +0000)]
ARP: Fix defend time check
Roy Marples [Wed, 22 Jan 2020 16:24:38 +0000 (16:24 +0000)]
privsep: Fix compile on Linux
setgroup requires <grp.h>
Roy Marples [Wed, 22 Jan 2020 16:21:12 +0000 (16:21 +0000)]
DHCP: Take interface reference on Address Defend failure
As the astate could be freed on dropping the DHCP state.
Roy Marples [Wed, 22 Jan 2020 12:00:10 +0000 (12:00 +0000)]
logging: Always log to syslog(3).
--logfile may not work that well in a chroot on receipt of SIGUSR2
because the path is of course different.
Might have to drop this option soon as I have no good ideas
on how to resolve it :(
Roy Marples [Tue, 21 Jan 2020 22:39:55 +0000 (22:39 +0000)]
Remove RC_SVCNAME.
We've not used that for quite a while now.....
Roy Marples [Tue, 21 Jan 2020 22:35:31 +0000 (22:35 +0000)]
privsep: Note CHROOT script
While here make BUILDING.md match reality and fix a warning
compiling without privsep.
Roy Marples [Tue, 21 Jan 2020 22:09:14 +0000 (22:09 +0000)]
Linux: setup mounts in chroot
This allows dhcpcd to work.
udev sadly requires /run/udev as well, so heh ho.
Roy Marples [Tue, 21 Jan 2020 20:37:12 +0000 (20:37 +0000)]
privsep: Fix compile on Alpine Linux
Roy Marples [Tue, 21 Jan 2020 20:17:27 +0000 (20:17 +0000)]
privsep: Only fetch PRIVSEP_USER at init
And not each time it's needed - we don't want a sudden change in
the details to affect a running dhcpcd.
Roy Marples [Tue, 21 Jan 2020 20:08:56 +0000 (20:08 +0000)]
privsep: copy configuration file into chroot
Only if it has changed.
Saves having to maintian it outside of dhcpcdm in a script or
something.
Roy Marples [Tue, 21 Jan 2020 16:26:41 +0000 (16:26 +0000)]
inet6: fix forced RA expiration for a given interface
Roy Marples [Tue, 21 Jan 2020 16:17:18 +0000 (16:17 +0000)]
privsep: chroot the master process
This means that the privileged actioneer process needs to cleanup
sockets and pidfile.
It also has some reliance on how dhcpcd is started to create
a decent chroot area AND copy the configuration file to it.
Roy Marples [Tue, 21 Jan 2020 16:11:37 +0000 (16:11 +0000)]
privsep: Close stdout/stderr after forking processes
Well, redirect them to /dev/null anyway.
Also tidy a few things in common whilst here.
Roy Marples [Tue, 21 Jan 2020 12:01:02 +0000 (12:01 +0000)]
BSD: Improve RTM_NEWADDR/RTM_DELADDR validaton some more
Roy Marples [Mon, 20 Jan 2020 11:59:06 +0000 (11:59 +0000)]
Only ignore address messages from ourself for deletion.
We need to process addition for flag changes.