]>
git.ipfire.org Git - thirdparty/dhcpcd.git/log
Roy Marples [Thu, 9 Apr 2020 20:55:33 +0000 (21:55 +0100)]
route: revert prior change to rt_new0
Roy Marples [Thu, 9 Apr 2020 20:08:05 +0000 (21:08 +0100)]
dhcpcd: always emit version when starting.
Roy Marples [Thu, 9 Apr 2020 16:27:18 +0000 (16:27 +0000)]
RTA_PREF was added in kernel-4.1
Roy Marples [Thu, 9 Apr 2020 16:19:07 +0000 (16:19 +0000)]
Linux: Note router preference when adding routes
This appears to just be cosmetic.
Roy Marples [Thu, 9 Apr 2020 15:38:18 +0000 (15:38 +0000)]
Linux: doesn't need to create temp addrs
Roy Marples [Thu, 9 Apr 2020 15:36:42 +0000 (16:36 +0100)]
Fix build on Linux
Roy Marples [Thu, 9 Apr 2020 15:16:37 +0000 (16:16 +0100)]
RA: Rework temporary address management
Vastly simpfly how they are generated and managed.
Temporary address generation now uses pure random numbers
rather than MD5ing over a random secret as arc4random should be
random enough. This change reflects RFC 4941bis.
Roy Marples [Wed, 8 Apr 2020 19:12:08 +0000 (20:12 +0100)]
linux: mount --bind real directory holding /dev/log
As systemd has the real socket in /run which doesn't help anyone
but itself.
Roy Marples [Tue, 7 Apr 2020 12:18:35 +0000 (13:18 +0100)]
BSD: Fix temporary address management
Roy Marples [Mon, 6 Apr 2020 20:13:39 +0000 (21:13 +0100)]
privsep: Don't overwrite initial sigmask
We really don't want to do that ....
Christos Zoulas [Mon, 6 Apr 2020 20:11:45 +0000 (21:11 +0100)]
scripts: Run with an empty sigmask
An empty signal mask is probably more appropriate, since most
programs presume that the signal mask is empty when they start
even when they are using signals.
Roy Marples [Sun, 5 Apr 2020 06:47:14 +0000 (07:47 +0100)]
privsep: If we fail to init privsep, continue
We continue if the privsep user cannot be found, so do the same
if passwd or similar is missing from the system.
This helps people who use dhcpcd in ramdisks to oneshot the config
for example to start iSCSI.
Roy Marples [Tue, 31 Mar 2020 10:51:24 +0000 (11:51 +0100)]
dhcpcd: dump all variables and optionally all interfaces
This allows someone to view pretty much the whole state.
Roy Marples [Mon, 30 Mar 2020 20:40:19 +0000 (21:40 +0100)]
privsep: Improve error when we cannot write the lease
No permission without context isn't great.
Roy Marples [Mon, 30 Mar 2020 20:40:04 +0000 (21:40 +0100)]
hooks: Build all hooks before installing
Roy Marples [Mon, 30 Mar 2020 20:21:47 +0000 (21:21 +0100)]
hooks: clean 30-hostname
As it's now built from 30-hostname.in
Roy Marples [Mon, 30 Mar 2020 20:20:12 +0000 (21:20 +0100)]
hooks: Remove 02-dump
As we now dump via the control socket, this is no longer needed.
Roy Marples [Mon, 30 Mar 2020 17:15:07 +0000 (18:15 +0100)]
BSD: Don't install 00-linux hook
Roy Marples [Fri, 3 Apr 2020 18:05:41 +0000 (18:05 +0000)]
Linux: improve IPv6 router reachability
Only mark as unreachable for NUD_FAILED.
Sadly the kernel emits this when the NDP entry is deleted for
whatever reason, which looks like a bug in the kernel.
Roy Marples [Fri, 3 Apr 2020 15:10:57 +0000 (16:10 +0100)]
Merge pull request #13 from sthen/patch-1
use TEMP_PREFERRED/VALID_LIFETIME for OpenBSD
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