dhcpcd
3 years agoRelease dhcpcd-6.11.7 dhcpcd-6.11.7
Roy Marples [Sat, 4 May 2019 09:12:53 +0000 (10:12 +0100)]
Release dhcpcd-6.11.7

3 years agoRemove old check
Roy Marples [Sat, 4 May 2019 09:12:39 +0000 (10:12 +0100)]
Remove old check

3 years agoDHCPv6: Fix a potential read overflow with D6_OPTION_PD_EXCLUDE
Roy Marples [Fri, 3 May 2019 13:44:06 +0000 (14:44 +0100)]
DHCPv6: Fix a potential read overflow with D6_OPTION_PD_EXCLUDE

dhcpcd only checks that the prefix length of the exclusion
matches the prefix length of the ia and equals the length of the
data in the option.
This could potentially overrun the in6_addr structure.

This is fixed by enforcing RFC 6603 section 4.2 option limits
more clearly.

Thanks to Maxime Villard <max@m00nbsd.net> for finding this.

3 years agoAllow make distinfo to work once more.
Roy Marples [Fri, 26 Apr 2019 14:23:22 +0000 (15:23 +0100)]
Allow make distinfo to work once more.

3 years agoRelease dhcpcd-6.11.6 dhcpcd-6.11.6
Roy Marples [Fri, 26 Apr 2019 14:18:15 +0000 (15:18 +0100)]
Release dhcpcd-6.11.6

3 years agoauth: Use consttime_memequal(3) to compare hashes
Roy Marples [Fri, 26 Apr 2019 14:16:44 +0000 (15:16 +0100)]
auth: Use consttime_memequal(3) to compare hashes
This stops any attacker from trying to infer secrets from latency.

Thanks to Maxime Villard <max@m00nbsd.net>

3 years agoDHCP: Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED
Roy Marples [Wed, 24 Apr 2019 11:35:34 +0000 (12:35 +0100)]
DHCP: Fix a potential 1 byte read overflow with DHO_OPTSOVERLOADED

This fix basically moves the option length check up and also
corrects off by one error with it.

Thanks to Maxime Villard <max@m00nbsd.net>

5 years agoFix build.
Roy Marples [Mon, 27 Mar 2017 15:45:49 +0000 (16:45 +0100)]
Fix build.

5 years agoFix a potential crash where the DHCP state could be freed during processing.
Roy Marples [Mon, 27 Mar 2017 15:01:52 +0000 (16:01 +0100)]
Fix a potential crash where the DHCP state could be freed during processing.

5 years agoFix a potential crash where the ARP state could be freed during processing.
Roy Marples [Mon, 27 Mar 2017 14:56:34 +0000 (15:56 +0100)]
Fix a potential crash where the ARP state could be freed during processing.

5 years agoFix runit service handling, [62772337e0].
Roy Marples [Sun, 15 Jan 2017 13:46:52 +0000 (13:46 +0000)]
Fix runit service handling, [62772337e0].

5 years agoTest we are given an interface in dhcpcd.conf before allocating a new interface
Roy Marples [Tue, 13 Dec 2016 20:12:06 +0000 (20:12 +0000)]
Test we are given an interface in dhcpcd.conf before allocating a new interface
block.
Fixes [fb7e08848b].

While here, use reallocarray(3).
Also, fix strskipwhite to return a NULL if the start of the string to the end
is white space and adjust logic accordingly to reduce binary size.

5 years agoDon't trust bootp->sname to be NULL terminated.
Roy Marples [Tue, 29 Nov 2016 21:27:01 +0000 (21:27 +0000)]
Don't trust bootp->sname to be NULL terminated.

5 years agoFix size of DHCPv6 addresses when making messages.
Roy Marples [Thu, 24 Nov 2016 11:39:59 +0000 (11:39 +0000)]
Fix size of DHCPv6 addresses when making messages.

5 years agoFix DAD on OpenBSD.
Roy Marples [Wed, 23 Nov 2016 21:12:03 +0000 (21:12 +0000)]
Fix DAD on OpenBSD.

5 years agoFix IPv6 DAD on OpenBSD.
Roy Marples [Wed, 23 Nov 2016 21:10:10 +0000 (21:10 +0000)]
Fix IPv6 DAD on OpenBSD.

5 years agoBackout prior, added stuff by mistake.
Roy Marples [Wed, 23 Nov 2016 21:08:30 +0000 (21:08 +0000)]
Backout prior, added stuff by mistake.

5 years agoFix IPv6 DAD on OpenBSD.
Roy Marples [Wed, 23 Nov 2016 21:05:16 +0000 (21:05 +0000)]
Fix IPv6 DAD on OpenBSD.

5 years agoOnly clear the address family routes we're re-loading.
Roy Marples [Wed, 23 Nov 2016 19:29:34 +0000 (19:29 +0000)]
Only clear the address family routes we're re-loading.

5 years agoFix adding subnet routes without a source address on OpenBSD.
Roy Marples [Wed, 23 Nov 2016 19:15:41 +0000 (19:15 +0000)]
Fix adding subnet routes without a source address on OpenBSD.

5 years agoMove ipv6_ctx into dhcpcd_ctx.
Roy Marples [Sat, 19 Nov 2016 16:15:45 +0000 (16:15 +0000)]
Move ipv6_ctx into dhcpcd_ctx.

5 years agoOnly build the routing tables for the address family we are interested in.
Roy Marples [Sat, 19 Nov 2016 10:17:07 +0000 (10:17 +0000)]
Only build the routing tables for the address family we are interested in.

5 years agoRevert prior, it's wrong.
Roy Marples [Fri, 18 Nov 2016 18:00:43 +0000 (18:00 +0000)]
Revert prior, it's wrong.

5 years agoStop spamming each route change needlessly.
Roy Marples [Fri, 18 Nov 2016 17:40:21 +0000 (17:40 +0000)]
Stop spamming each route change needlessly.

5 years agoOnly compare the address part length as the rest maybe garbage.
Roy Marples [Fri, 18 Nov 2016 16:41:01 +0000 (16:41 +0000)]
Only compare the address part length as the rest maybe garbage.

5 years agoImprove NTP timestamp from realtime and fix the double host to network translation...
Roy Marples [Fri, 18 Nov 2016 15:27:20 +0000 (15:27 +0000)]
Improve NTP timestamp from realtime and fix the double host to network translation on it.

5 years agoImprove NTP timestamp from realtime and fix the double host to network translation...
Roy Marples [Fri, 18 Nov 2016 15:26:45 +0000 (15:26 +0000)]
Improve NTP timestamp from realtime and fix the double host to network translation on it.

5 years agoMerge fixes from dhcpcd-6 for authentication token algo.
Roy Marples [Fri, 18 Nov 2016 13:51:50 +0000 (13:51 +0000)]
Merge fixes from dhcpcd-6 for authentication token algo.

5 years agoAuthentication token support should have an algo of 0.
Roy Marples [Fri, 18 Nov 2016 13:49:22 +0000 (13:49 +0000)]
Authentication token support should have an algo of 0.

5 years agoFix markup.
Roy Marples [Fri, 18 Nov 2016 13:48:12 +0000 (13:48 +0000)]
Fix markup.

5 years agoDon't assume we always have RTA_IFA.
Roy Marples [Thu, 17 Nov 2016 12:26:30 +0000 (12:26 +0000)]
Don't assume we always have RTA_IFA.

5 years agoImprove nl80211 support as we now know how to work out the SSID we're
Roy Marples [Thu, 17 Nov 2016 12:10:18 +0000 (12:10 +0000)]
Improve nl80211 support as we now know how to work out the SSID we're
connected to.

5 years agoImprove nl80211 support as we now know how to work out the SSID we're
Roy Marples [Thu, 17 Nov 2016 11:52:11 +0000 (11:52 +0000)]
Improve nl80211 support as we now know how to work out the SSID we're
connected to.

5 years agoFix compile on FreeBSD.
Roy Marples [Wed, 16 Nov 2016 13:43:08 +0000 (13:43 +0000)]
Fix compile on FreeBSD.

5 years agoFix sa_fromprefix for real on BSD.
Roy Marples [Thu, 10 Nov 2016 18:35:21 +0000 (18:35 +0000)]
Fix sa_fromprefix for real on BSD.

5 years agoSet sa_len when creating a sockaddr from a prefix.
Roy Marples [Thu, 10 Nov 2016 18:26:32 +0000 (18:26 +0000)]
Set sa_len when creating a sockaddr from a prefix.

5 years agoFix size of DHCPv6 addresses when making messages.
Roy Marples [Thu, 10 Nov 2016 13:47:46 +0000 (13:47 +0000)]
Fix size of DHCPv6 addresses when making messages.

5 years agoDo somewith with getline result in configure to make it pass.
Roy Marples [Tue, 8 Nov 2016 23:05:05 +0000 (23:05 +0000)]
Do somewith with getline result in configure to make it pass.

5 years agoDo somewith with getline result in configure to make it pass.
Roy Marples [Tue, 8 Nov 2016 23:03:28 +0000 (23:03 +0000)]
Do somewith with getline result in configure to make it pass.

5 years agoReject routes on Linux don't use a gateway.
Roy Marples [Tue, 8 Nov 2016 22:43:13 +0000 (22:43 +0000)]
Reject routes on Linux don't use a gateway.

5 years agoFix working with REJECT routes.
Roy Marples [Tue, 8 Nov 2016 22:42:34 +0000 (22:42 +0000)]
Fix working with REJECT routes.

5 years agoMove union sa_ss to sa.h
Roy Marples [Tue, 8 Nov 2016 22:41:34 +0000 (22:41 +0000)]
Move union sa_ss to sa.h
Fix sa_fromprefix so that zero'd netmask bytes do not overwrite the last bit
set.
If assert is being used, add tests that sa_fromprefix and sa_toprefix generate
correct results by agreeing with each other.

5 years agoIf netmask is INADDR_ANY then CIDR must be 0.
Roy Marples [Tue, 8 Nov 2016 21:09:31 +0000 (21:09 +0000)]
If netmask is INADDR_ANY then CIDR must be 0.

5 years agoFix rt_find on linux
Roy Marples [Tue, 8 Nov 2016 20:57:26 +0000 (20:57 +0000)]
Fix rt_find on linux

5 years agoRemove debug
Roy Marples [Tue, 8 Nov 2016 20:57:16 +0000 (20:57 +0000)]
Remove debug

5 years agoDefault DBDIR from /var/db to /var/db/dhcpcd.
Roy Marples [Tue, 8 Nov 2016 12:17:20 +0000 (12:17 +0000)]
Default DBDIR from /var/db to /var/db/dhcpcd.
Move dhcpcd.duid and dhcpcd.secret from /etc into /var/db/dhcpcd.
Move leases and RDM monotonc from /var/db into /var/db/dhcpcd.
All moves files have the dhcpcd{.-} prefix dropped.

5 years agoRemove distinfo files before making them.
Roy Marples [Sat, 5 Nov 2016 11:35:39 +0000 (11:35 +0000)]
Remove distinfo files before making them.

5 years agoRemove distinfo files before making them.
Roy Marples [Sat, 5 Nov 2016 11:35:13 +0000 (11:35 +0000)]
Remove distinfo files before making them.

5 years agoKeep the distinfo in the signed result.
Roy Marples [Sat, 5 Nov 2016 11:18:35 +0000 (11:18 +0000)]
Keep the distinfo in the signed result.

5 years agoKeep the distinfo in the signed result.
Roy Marples [Sat, 5 Nov 2016 11:17:45 +0000 (11:17 +0000)]
Keep the distinfo in the signed result.

5 years agomake distinfo now produces a .distinfo file which contains checksum(s) of
Roy Marples [Fri, 4 Nov 2016 15:37:43 +0000 (15:37 +0000)]
make distinfo now produces a .distinfo file which contains checksum(s) of
the dist file. This distinfo file is then signed with a PGP key.

5 years agoFix clean files
Roy Marples [Fri, 4 Nov 2016 15:34:42 +0000 (15:34 +0000)]
Fix clean files

5 years agomake distinfo now produces a .distinfo file which contains checksum(s) of
Roy Marples [Fri, 4 Nov 2016 15:31:14 +0000 (15:31 +0000)]
make distinfo now produces a .distinfo file which contains checksum(s) of
the dist file. This distinfo file is then signed with a PGP key.

5 years agoRemove address family specific routing and introduce address family
Roy Marples [Tue, 25 Oct 2016 15:33:02 +0000 (15:33 +0000)]
Remove address family specific routing and introduce address family
agnostic routing.
This makes the platform drivers simpler and reduces some code duplication.
Needs a lot of testing.

5 years agologger output always goes to stderr now.
Roy Marples [Mon, 24 Oct 2016 19:24:38 +0000 (19:24 +0000)]
logger output always goes to stderr now.

5 years agohwaddr_ntoa now takes a void * as a source.
Roy Marples [Mon, 24 Oct 2016 19:21:23 +0000 (19:21 +0000)]
hwaddr_ntoa now takes a void * as a source.

5 years agoRemove debug.
Roy Marples [Mon, 24 Oct 2016 19:18:43 +0000 (19:18 +0000)]
Remove debug.

5 years agoReturn an error.
Roy Marples [Fri, 14 Oct 2016 09:19:42 +0000 (09:19 +0000)]
Return an error.

5 years agoAlways create the ARP state when binding .... when adding the address only search...
Roy Marples [Fri, 14 Oct 2016 09:19:29 +0000 (09:19 +0000)]
Always create the ARP state when binding .... when adding the address only search for it. This means we always have the correct callbacks.

5 years agoMerge BSD IPv6 kernel checking from trunk.
Roy Marples [Fri, 14 Oct 2016 09:13:38 +0000 (09:13 +0000)]
Merge BSD IPv6 kernel checking from trunk.

5 years agoRe-work checking IPv6 kernel settings on BSD.
Roy Marples [Fri, 14 Oct 2016 09:07:42 +0000 (09:07 +0000)]
Re-work checking IPv6 kernel settings on BSD.

5 years agoSupport kernels which implement RFC5227.
Roy Marples [Fri, 14 Oct 2016 08:55:04 +0000 (08:55 +0000)]
Support kernels which implement RFC5227.
This means we don't have to open an ARP socket unless we need to ARPing.
Allow ARP an ARPing to be optional features.

5 years agoMerge dhcpcd-6 changes.
Roy Marples [Mon, 10 Oct 2016 08:50:04 +0000 (08:50 +0000)]
Merge dhcpcd-6 changes.

5 years agoI updated this file this year.
Roy Marples [Mon, 10 Oct 2016 08:47:56 +0000 (08:47 +0000)]
I updated this file this year.

5 years agoIf there is no announced_cb, free the arp state.
Roy Marples [Mon, 10 Oct 2016 08:47:13 +0000 (08:47 +0000)]
If there is no announced_cb, free the arp state.

5 years agoReturn early to make code more readable.
Roy Marples [Mon, 10 Oct 2016 08:46:41 +0000 (08:46 +0000)]
Return early to make code more readable.

5 years agoFix build with DEBUG_NS
Roy Marples [Mon, 10 Oct 2016 08:04:34 +0000 (08:04 +0000)]
Fix build with DEBUG_NS

5 years agoCopy pdp.prefix as it's not aligned.
Roy Marples [Sun, 9 Oct 2016 08:16:42 +0000 (08:16 +0000)]
Copy pdp.prefix as it's not aligned.

5 years agoRelease dhcpcd-6.11.5 dhcpcd-6.11.5
Roy Marples [Sun, 9 Oct 2016 08:07:17 +0000 (08:07 +0000)]
Release dhcpcd-6.11.5

5 years agoCorrect define to __OpenBSD__. Fixes [ad8b5130d4] again.
Roy Marples [Sun, 9 Oct 2016 08:06:10 +0000 (08:06 +0000)]
Correct define to __OpenBSD__. Fixes [ad8b5130d4] again.

5 years agoCorrect define to __OpenBSD__.
Roy Marples [Sun, 9 Oct 2016 08:02:37 +0000 (08:02 +0000)]
Correct define to __OpenBSD__.
Fixes [ad8b5130d4] again.

5 years agoMerge fixes from branch
Roy Marples [Fri, 7 Oct 2016 10:01:09 +0000 (10:01 +0000)]
Merge fixes from branch

5 years agoMerge fixes from branch
Roy Marples [Fri, 7 Oct 2016 10:01:09 +0000 (10:01 +0000)]
Merge fixes from branch

5 years agoFix build system to make import correctly for authentication.
Roy Marples [Fri, 7 Oct 2016 09:42:38 +0000 (09:42 +0000)]
Fix build system to make import correctly for authentication.

5 years agoFix import for auth
Roy Marples [Fri, 7 Oct 2016 08:34:00 +0000 (08:34 +0000)]
Fix import for auth

5 years agoRelease dhcpcd-6.11.4 dhcpcd-6.11.4
Roy Marples [Fri, 7 Oct 2016 08:05:10 +0000 (08:05 +0000)]
Release dhcpcd-6.11.4

5 years agoCast away some more compile errors.
Roy Marples [Thu, 6 Oct 2016 10:36:47 +0000 (10:36 +0000)]
Cast away some more compile errors.

5 years agoRemove debug.
Roy Marples [Wed, 5 Oct 2016 19:20:39 +0000 (19:20 +0000)]
Remove debug.

5 years agoFix sending DHCPv6 vendor option.
Roy Marples [Wed, 5 Oct 2016 19:20:13 +0000 (19:20 +0000)]
Fix sending DHCPv6 vendor option.

5 years agoUpdate copyright and intent.
Roy Marples [Wed, 5 Oct 2016 16:33:34 +0000 (16:33 +0000)]
Update copyright and intent.

5 years agoCopy out ND option structs for correct alignment.
Roy Marples [Wed, 5 Oct 2016 16:30:19 +0000 (16:30 +0000)]
Copy out ND option structs for correct alignment.

5 years agoAssert size for more structs.
Roy Marples [Wed, 5 Oct 2016 15:00:35 +0000 (15:00 +0000)]
Assert size for more structs.

5 years agoRemove packed from these structs.
Roy Marples [Wed, 5 Oct 2016 14:06:20 +0000 (14:06 +0000)]
Remove packed from these structs.

5 years agoFix compile on Linux with clang.
Roy Marples [Wed, 5 Oct 2016 12:19:59 +0000 (12:19 +0000)]
Fix compile on Linux with clang.

5 years agoFix some gcc warnings.
Roy Marples [Wed, 5 Oct 2016 11:44:57 +0000 (11:44 +0000)]
Fix some gcc warnings.

5 years agoTry and avoid using __packed.
Roy Marples [Wed, 5 Oct 2016 11:28:48 +0000 (11:28 +0000)]
Try and avoid using __packed.
Instead use __CTASSERT to ensure the structure is the correct size for on-wire.
This allows for more efficient binaries to be produced.

5 years agoAuth should work on void rather than a type.
Roy Marples [Wed, 5 Oct 2016 11:03:32 +0000 (11:03 +0000)]
Auth should work on void rather than a type.

5 years agoStart work on dhcpcd-7
Roy Marples [Wed, 5 Oct 2016 11:01:00 +0000 (11:01 +0000)]
Start work on dhcpcd-7

5 years agoCreate new branch named "dhcpcd-6"
Roy Marples [Wed, 5 Oct 2016 10:59:32 +0000 (10:59 +0000)]
Create new branch named "dhcpcd-6"

5 years agoRemove hack to add IPv6 LL address as early as possible.
Roy Marples [Tue, 4 Oct 2016 09:40:56 +0000 (09:40 +0000)]
Remove hack to add IPv6 LL address as early as possible.
This only worked on pre NetBSD-7.0 systems which did not support ND6_IFF_AUTO_LINKLOCAL.

By removing it, we make the code smaller and removes the possibility of in-advertently
re-ordering interfaces in dhcpcd during the init phases.

Should finally fix [c9d04817fa].

5 years agoGuard against the possibility of no config..... may fix [c9d04817fa].
Roy Marples [Mon, 3 Oct 2016 20:07:52 +0000 (20:07 +0000)]
Guard against the possibility of no config..... may fix [c9d04817fa].

5 years agoValidate lease before setting state to REQUEST when REPLY is recieved in
Roy Marples [Mon, 3 Oct 2016 19:41:11 +0000 (19:41 +0000)]
Validate lease before setting state to REQUEST when REPLY is recieved in
DISCOVER.

5 years agoRevert prior and test for DH6S_REBIND rather than not DH6S_DISCOVER.
Roy Marples [Mon, 3 Oct 2016 17:55:43 +0000 (17:55 +0000)]
Revert prior and test for DH6S_REBIND rather than not DH6S_DISCOVER.

5 years agoDon't re-enter the discover phase on receipt of an invalid offer if we are already...
Roy Marples [Mon, 3 Oct 2016 16:42:55 +0000 (16:42 +0000)]
Don't re-enter the discover phase on receipt of an invalid offer if we are already in the discover phase.

5 years agoIf renew or rebind is not set, always use a default from the lowest pltime
Roy Marples [Sun, 2 Oct 2016 15:07:21 +0000 (15:07 +0000)]
If renew or rebind is not set, always use a default from the lowest pltime
even if the lease does not expire, as some IA/PD might expire.
Thanks to Guy Yur.

5 years agoThe ability to add LL addresses is not dependant on using SLAAC privacy,
Roy Marples [Sun, 2 Oct 2016 10:54:52 +0000 (10:54 +0000)]
The ability to add LL addresses is not dependant on using SLAAC privacy,
just the carrier being up.

Fixes [c9d04817fa].

5 years agoReport compiled in features in --version.
Roy Marples [Tue, 27 Sep 2016 10:34:29 +0000 (10:34 +0000)]
Report compiled in features in --version.

5 years agoOnly enable IPv4LL when INET is enabled.
Roy Marples [Tue, 27 Sep 2016 10:21:31 +0000 (10:21 +0000)]
Only enable IPv4LL when INET is enabled.
Only enable DHCPv6 when INET6 is enabled.

5 years agoAllow DHCPv6 support to be compiled out.
Roy Marples [Tue, 27 Sep 2016 10:17:39 +0000 (10:17 +0000)]
Allow DHCPv6 support to be compiled out.

5 years agoMove the #ifdef higher to exclude static consts.
Roy Marples [Tue, 27 Sep 2016 09:00:26 +0000 (09:00 +0000)]
Move the #ifdef higher to exclude static consts.