]>
git.ipfire.org Git - thirdparty/dhcpcd.git/log
Roy Marples [Fri, 20 Dec 2019 22:05:59 +0000 (22:05 +0000)]
options: Fix allocating the script option
When passing PARSE_STRING_NULL we expect to store the string
NULL terminated. As such, allocate space for it an ensure we have
space for it.
Roy Marples [Fri, 20 Dec 2019 11:38:14 +0000 (11:38 +0000)]
Release dhcpcd-8.1.3
Roy Marples [Sat, 7 Dec 2019 17:06:18 +0000 (17:06 +0000)]
DHCP: dl is always >0 at this point, so remove check.
Found by the LGTM bot.
Roy Marples [Wed, 11 Dec 2019 16:09:18 +0000 (16:09 +0000)]
compat: Add a guard to _strtoi.h
Not really needed but LGTM wants it which blows.
Should really take this upstream.....
Roy Marples [Wed, 18 Dec 2019 14:16:18 +0000 (14:16 +0000)]
Linux: Move RTA_OK and RTA_NEXT from a while to a for loop.
Roy Marples [Thu, 19 Dec 2019 15:36:31 +0000 (15:36 +0000)]
DHCP: Ensure we have a lease to extract options from.
Roy Marples [Tue, 17 Dec 2019 22:32:21 +0000 (22:32 +0000)]
DHCP6: Remove now unused vars
Roy Marples [Tue, 17 Dec 2019 22:23:56 +0000 (22:23 +0000)]
DHCP6: Add disabled code to allow packet replay
I get bored of adding similar code from time to time just to
aid debugging, so let's just add it in.
Someone else might find it useful too.
Roy Marples [Tue, 17 Dec 2019 22:16:26 +0000 (22:16 +0000)]
DHCP6: Rework delegation deprecation
Split ipv6_addaddrs out so ipv6_doaddr can operate on a single address.
Call this when deprecating delegated addresses to avoid calling
ipv6_addaddrs.
This allows a more simple ipv6_addaddrs that doesn't need to test
which address collection we are deleting from and removes DHCPv6
specific code from the generic IPv6 module.
Roy Marples [Mon, 16 Dec 2019 16:56:17 +0000 (16:56 +0000)]
DHCP6: Fix deprecating a delegated prefix
Be sure to remove the address using the right TAILQ member.
While here, simplify the initialisation of pd_pfxs.
Roy Marples [Mon, 16 Dec 2019 12:32:43 +0000 (12:32 +0000)]
options: Suboption 3 of NTP Server is a FQDN
As such it should be domain and not ip6address.
Roy Marples [Thu, 12 Dec 2019 14:06:20 +0000 (14:06 +0000)]
DHCP: Don't warn about expiry of deprecated addresses
Roy Marples [Tue, 10 Dec 2019 21:44:24 +0000 (21:44 +0000)]
IPv6ND: Fix reachable test
Roy Marples [Fri, 29 Nov 2019 23:53:11 +0000 (23:53 +0000)]
dhcpcd: Only report SSID when we have a carrier
Roy Marples [Wed, 27 Nov 2019 15:06:47 +0000 (15:06 +0000)]
DHCP6: Fix prior to log an error
Roy Marples [Tue, 26 Nov 2019 19:58:42 +0000 (19:58 +0000)]
DHCP6: Improve API for privsep
Roy Marples [Tue, 26 Nov 2019 19:57:30 +0000 (19:57 +0000)]
DHCP: Improve API for privsep
Roy Marples [Tue, 19 Nov 2019 22:02:05 +0000 (22:02 +0000)]
Linux: remove XX debug
Roy Marples [Tue, 19 Nov 2019 21:13:15 +0000 (21:13 +0000)]
Linux: Support kernels without PR_SET_MM_MAP
Roy Marples [Sun, 17 Nov 2019 19:57:27 +0000 (19:57 +0000)]
Linux: prefer ms RA times
The old sysctls have apparently been deprecated since 2.6.12.
Sascha Wildner [Fri, 15 Nov 2019 11:28:28 +0000 (11:28 +0000)]
Spelling fixes
Roy Marples [Wed, 13 Nov 2019 10:23:52 +0000 (10:23 +0000)]
Release dhcpcd-8.1.2
Roy Marples [Tue, 12 Nov 2019 16:01:50 +0000 (16:01 +0000)]
dhcpcd: report SSID connected to when we gain carrier
Helps debugging without the need for explicit debug.
Roy Marples [Sun, 10 Nov 2019 21:12:31 +0000 (21:12 +0000)]
RA: Set mtu to zero and then pull in the MTU option if any
Incase the router sets it back to unspecified.
Nathan Houghton [Sun, 10 Nov 2019 20:53:11 +0000 (20:53 +0000)]
OpenBSD: Support LINK_STATE_HALF_DUPLEX and LINK_STATE_FULL_DUPLEX
For if_msghdr messages from route(4).
Roy Marples [Sun, 10 Nov 2019 20:43:04 +0000 (20:43 +0000)]
IPv6ND: If a router is reachable again, don't solicit another.
Roy Marples [Sun, 10 Nov 2019 20:39:52 +0000 (20:39 +0000)]
RA: Warn if advertised MTU is greater than link MTU
Roy Marples [Sun, 10 Nov 2019 15:15:16 +0000 (15:15 +0000)]
BSD: Try and set linkmtu for the interface just to be nice.
If it fails, zero it out and try again - only the linkmtu should
fail really. This is fine as we fix it against the route itself.
Roy Marples [Sun, 10 Nov 2019 02:46:27 +0000 (02:46 +0000)]
OpenBSD: Fix prior - OS cannot set any RA bits such as hop limit.
Roy Marples [Sat, 9 Nov 2019 22:22:59 +0000 (22:22 +0000)]
BSD: strlcpy > strncpy
Roy Marples [Sat, 9 Nov 2019 22:22:28 +0000 (01:22 +0300)]
Solaris: Fix compile with prior
Roy Marples [Sat, 9 Nov 2019 22:14:28 +0000 (22:14 +0000)]
Linux: fix compile for prior
Roy Marples [Sat, 9 Nov 2019 22:03:19 +0000 (22:03 +0000)]
INET6: Apply hoplimit, reachable and retrans timer values from RA.
Only tested thus far on NetBSD.
While here, fix prior to not lose the first sorted route.
Roy Marples [Sat, 9 Nov 2019 14:37:54 +0000 (14:37 +0000)]
INET6: Sort routers when reachability changes
If unreachable, try and install a better default router.
Roy Marples [Wed, 6 Nov 2019 12:22:28 +0000 (12:22 +0000)]
script: Ensure pid is initialised.
Roy Marples [Tue, 5 Nov 2019 21:54:32 +0000 (21:54 +0000)]
DHCP: When rebinding ensure we have a DHCP ARP state
So we can defend the address.
Roy Marples [Tue, 5 Nov 2019 21:01:19 +0000 (21:01 +0000)]
Linux: rename _open_link_socket to if_linksocket
Roy Marples [Tue, 5 Nov 2019 17:18:02 +0000 (17:18 +0000)]
Linux: improve the netlink API more
By putting the callback arg with the callback function.
Roy Marples [Tue, 5 Nov 2019 16:23:02 +0000 (16:23 +0000)]
build: Improve detection of dlopen(3) in libdl
Roy Marples [Tue, 5 Nov 2019 16:22:39 +0000 (16:22 +0000)]
dev: remove pointless cast
Roy Marples [Tue, 5 Nov 2019 15:52:57 +0000 (15:52 +0000)]
INET: Fix corruption of IPv4 address flags when renewing
What a mistaka to maka!
Roy Marples [Tue, 5 Nov 2019 15:23:10 +0000 (15:23 +0000)]
Linux: always open a netlink socket when writing netlink messages
While here, bring some function names into the same style.
Roy Marples [Mon, 4 Nov 2019 20:21:30 +0000 (20:21 +0000)]
build: Improve import-src target
Incase a supposed source file file does not exist.
Roy Marples [Mon, 4 Nov 2019 20:02:36 +0000 (20:02 +0000)]
and more pretty
Roy Marples [Mon, 4 Nov 2019 19:56:32 +0000 (19:56 +0000)]
build: make prior output more pretty
Roy Marples [Mon, 4 Nov 2019 19:56:51 +0000 (19:56 +0000)]
build: Check compiler actually supports address sanitisation.
Roy Marples [Mon, 4 Nov 2019 17:21:33 +0000 (17:21 +0000)]
BSD: Disable kernel RTADV sysctl earlier
Just makes life a bit easier.
Roy Marples [Sun, 3 Nov 2019 23:24:09 +0000 (23:24 +0000)]
build: Enforce address sanitisaton when debugging.
Roy Marples [Sun, 3 Nov 2019 10:13:54 +0000 (10:13 +0000)]
dhcpcd: Set ctx.ifaces to NULL after freeing
Because they it might be used trying to find an interface to assign
our option routes to when freed if never used.
Roy Marples [Fri, 1 Nov 2019 23:34:37 +0000 (23:34 +0000)]
eloop: Fix a segfault if we free a NULL eloop
Roy Marples [Fri, 1 Nov 2019 23:29:06 +0000 (23:29 +0000)]
control: when closing, remove from eloop.
Roy Marples [Fri, 1 Nov 2019 22:30:33 +0000 (22:30 +0000)]
script: Improve API
Roy Marples [Fri, 25 Oct 2019 14:15:22 +0000 (15:15 +0100)]
DHCP6: Simplify opening the UDP port for all interfaces.
Roy Marples [Fri, 25 Oct 2019 14:04:12 +0000 (15:04 +0100)]
DHCP: Rework closing BPF and seeing if we need to open UDP
Just easier to read.
Roy Marples [Fri, 25 Oct 2019 13:44:23 +0000 (14:44 +0100)]
DHCP: Simplify opening the UDP port for all interfaces.
Roy Marples [Fri, 25 Oct 2019 12:32:38 +0000 (13:32 +0100)]
ARP: Add interface to arp_state
Simplifies the codes slightly and allows a backreference if
we need to pass the ARP state as a context.
Roy Marples [Fri, 25 Oct 2019 12:20:20 +0000 (13:20 +0100)]
Fix prior on other os
Roy Marples [Fri, 25 Oct 2019 12:18:39 +0000 (15:18 +0300)]
Solaris: Fix prior by receving IP6_PKTINFO
Roy Marples [Fri, 25 Oct 2019 11:49:01 +0000 (12:49 +0100)]
Split *_recv() into *_recv() and *_recvmsg() functions
The *_recvmsg() function has the whole packet in the first and
only iov.
Serves little purpose now, but will be used in the future.
Roy Marples [Fri, 25 Oct 2019 11:36:22 +0000 (12:36 +0100)]
Fix prior
Roy Marples [Fri, 25 Oct 2019 10:55:52 +0000 (11:55 +0100)]
Whitespace.
Roy Marples [Fri, 25 Oct 2019 10:52:26 +0000 (11:52 +0100)]
BSD: Use IP_RECVIF
IP_RECVIF is supported on all BSD platforms as well as Solaris,
so it's more widely available than IP_PKTINFO.
This allows us to ensure that all platforms can retrieve the
receving interface from UDP network packets and thus make the code
paths a lot easier.
Roy Marples [Fri, 25 Oct 2019 10:34:06 +0000 (11:34 +0100)]
eloop: Add eloop_clear function
This will allow forking processes for future privsep work.
Roy Marples [Wed, 23 Oct 2019 10:21:38 +0000 (11:21 +0100)]
INET: Fix a potential memory leak
When someone deletes the address from under us.
Roy Marples [Wed, 23 Oct 2019 10:12:13 +0000 (11:12 +0100)]
Linux: validate RTM_NEWADDR/RTM_DELADDR for AF_INET as well.
Roy Marples [Tue, 22 Oct 2019 21:50:17 +0000 (22:50 +0100)]
INET: If we fail to add an address that already exists, don't free it
Should not happen in production.....
Roy Marples [Tue, 22 Oct 2019 11:39:56 +0000 (12:39 +0100)]
Linux: Validate RTM_DELADDR/RTM_NEWADDR messages for IPv6
To ensure that if messages lag, they can be ignored.
How to do similar without a heavy getifaddrs call for IPv4?
Peter Bui [Sun, 20 Oct 2019 21:15:08 +0000 (17:15 -0400)]
Fix building on systems with musl (#10)
musl has its own definition of struct ethhdr, so only include
netinet/if_ether.h on systems with GLIBC. For the ARPHDR constants, we
must include linux/if_arp.h instead.
Roy Marples [Sun, 20 Oct 2019 10:14:11 +0000 (11:14 +0100)]
dhcpcd: Run the STOPPED hook reason for the interface on timeout
If not in master mode.
Roy Marples [Sat, 19 Oct 2019 20:45:26 +0000 (21:45 +0100)]
Merge pull request #9 from vegerot/patch-1
Added documentation for undocumented option
Sergei Trofimovich [Wed, 16 Oct 2019 21:52:26 +0000 (22:52 +0100)]
DHCP: Fix prior to not waste space
Max Coplan [Wed, 16 Oct 2019 21:31:20 +0000 (17:31 -0400)]
Added documentation for undocumented option
The dbdir option is used to specify the location of the DHCPd database. The default /var/db is not FHS compliant so some may wish to change this to
Roy Marples [Wed, 16 Oct 2019 18:41:43 +0000 (19:41 +0100)]
Typo, thanks to Arfrever.
Roy Marples [Wed, 16 Oct 2019 14:21:58 +0000 (15:21 +0100)]
Relese dhcpcd-8.1.1
Roy Marples [Wed, 16 Oct 2019 14:19:58 +0000 (15:19 +0100)]
FreeBSD: Fix test for setproctitle
Roy Marples [Wed, 16 Oct 2019 13:56:21 +0000 (14:56 +0100)]
DHCP: Fix strict aliasing of checksumming the pseudo header
in_cksum relies on accessing the data by uint16_t blocks.
Because the underlying object we send to in_cksum is struct ip,
we need to use union to allow access by uint16_t so strict aliasing
rules are not broken.
Roy Marples [Wed, 16 Oct 2019 13:48:01 +0000 (14:48 +0100)]
compat: Fix UB in arc4random.
Roy Marples [Tue, 15 Oct 2019 13:06:51 +0000 (14:06 +0100)]
DHCP: Fix aliasing issues accessing the UDP header
Not been a problem before, but it seems to be now.
Copy out the UDP header rather than accessing it directly.
Adjust the code to zero out the UDP checksum in the packet
to compensate ..... and put the checksum back afterwards.
Roy Marples [Tue, 15 Oct 2019 13:03:27 +0000 (14:03 +0100)]
compat: Go back to linux specific setproctitle
Solaris does not work with argv stamping and this is much cleaner
anyway.
Roy Marples [Tue, 15 Oct 2019 12:40:32 +0000 (13:40 +0100)]
Revert "compat: Use more portable setproctitle from nginx"
This reverts commit
cbcb352f10de5ba5185860f20e148509081f9d2f .
Roy Marples [Tue, 15 Oct 2019 12:40:13 +0000 (13:40 +0100)]
Revert "compat: Fix setproctitle on Solaris"
This reverts commit
c085a2836f8439bc3e9d01a85d399afb8ad1dc12 .
Roy Marples [Tue, 15 Oct 2019 11:39:44 +0000 (14:39 +0300)]
compat: Fix setproctitle on Solaris
Roy Marples [Tue, 15 Oct 2019 10:59:58 +0000 (11:59 +0100)]
compat: Use more portable setproctitle from nginx
Hopefully works on older Linux and Solaris.
Roy Marples [Tue, 15 Oct 2019 10:57:17 +0000 (11:57 +0100)]
dhcp: Allow for trailing FCS in the packet.
Maxime Villard [Tue, 15 Oct 2019 08:57:26 +0000 (09:57 +0100)]
dhcp: Fix incoming verification and checksum routines
While here remove unused get_option_raw define.
Roy Marples [Mon, 14 Oct 2019 20:49:31 +0000 (21:49 +0100)]
compat: Add setproctitle from LXC
Roy Marples [Mon, 14 Oct 2019 15:01:00 +0000 (16:01 +0100)]
inet6: Fix a potential crash learning addresses
Interface maybe active but without options.
In this case, check the global state of IPv6.
Roy Marples [Fri, 11 Oct 2019 10:37:10 +0000 (11:37 +0100)]
Release dhcpcd-8.1.0
Roy Marples [Fri, 11 Oct 2019 10:24:38 +0000 (11:24 +0100)]
BPF: Move validation logic from BPF to consumers
Even though we program the BPF filter should we trust it?
On Linux at least there is a window between opening the socket,
binding the interface and setting the filter where we receive data.
This data is NOT checked OR flushed and IS returned when reading.
We have no way of flushing it other than reading these packets!
But we don't know if they passed the filter or not ..... so we need
to validate each and every packet that comes through ourselves as well.
Even if Linux does fix this sorry state, who is to say other kernels
don't have bugs causing a similar effect?
As such, let's strive to keep the filters just for pattern matching
to avoid waking dhcpcd up.
Roy Marples [Thu, 10 Oct 2019 11:00:46 +0000 (12:00 +0100)]
Minor optimisation and fix to prior.
Roy Marples [Thu, 10 Oct 2019 10:54:47 +0000 (10:54 +0000)]
BSD: Add IFT_TUNNEL
Requires explicit support but shouldn't log a code.
Roy Marples [Thu, 10 Oct 2019 10:20:09 +0000 (11:20 +0100)]
DHCP6: Remove 0 sla and 0 prefix means whole prefix.
If we get a /48 we can still use /64 with a sla of 0.
It's all valid, my bad.
Roy Marples [Wed, 9 Oct 2019 16:39:48 +0000 (17:39 +0100)]
man: some virtual interfaces ....
For example dummy on Linux still works by default.
There could be others....
Roy Marples [Wed, 9 Oct 2019 13:58:09 +0000 (14:58 +0100)]
man: Note the default ignoring of virtual interfaces.
Roy Marples [Wed, 9 Oct 2019 13:20:23 +0000 (14:20 +0100)]
BSD: Ignore bridge interfaces
Roy Marples [Wed, 9 Oct 2019 13:09:20 +0000 (14:09 +0100)]
Linux: Ignore TAP and Bridge interfaces by default
We can check these places:
/sys/class/net/tap0/tun_flags
/sys/class/net/br0/bridge
Roy Marples [Wed, 9 Oct 2019 12:37:12 +0000 (13:37 +0100)]
BSD: Ignore the firewire interface as well.
Roy Marples [Wed, 9 Oct 2019 12:34:34 +0000 (13:34 +0100)]
BSD: Ignore interface groups as we would the interface name
Incase someone renames tap0 to foo4.
Roy Marples [Wed, 9 Oct 2019 11:47:06 +0000 (12:47 +0100)]
if: Ignore TAP interfaces by default
TAP interfaces are virtual ethernet and not really distinguishable
from real interfaces other than the interface name.
On BSD the interfaces are always called tapN.
Roy Marples [Wed, 9 Oct 2019 10:28:03 +0000 (11:28 +0100)]
DHCP6: Work better with infinite addresses
And as such just log infinite lease rather than an arbitary
number.