]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
6 years agoBSD: Warn when kernel does not support sending ND6 advertisements
Roy Marples [Mon, 29 Jul 2019 13:46:25 +0000 (14:46 +0100)] 
BSD: Warn when kernel does not support sending ND6 advertisements

6 years agoND6: Disable advertising on OS other than NetBSD and Linux
Roy Marples [Mon, 29 Jul 2019 12:31:23 +0000 (13:31 +0100)] 
ND6: Disable advertising on OS other than NetBSD and Linux

It's only used for IP6 address sharing to prefer an interface,
but this only works on NetBSD. It might work on Linux too.
For all other OS advertising either fails to work (OpenBSD)
or erroneously logs duplicate address messages (all other BSD's).

6 years agoDragonFlyBSD: Fix compile
Roy Marples [Mon, 29 Jul 2019 11:51:13 +0000 (12:51 +0100)] 
DragonFlyBSD: Fix compile

6 years agoDHCP6: Change state to REQEST when any IA has NOBINDING status
Roy Marples [Mon, 29 Jul 2019 07:39:57 +0000 (08:39 +0100)] 
DHCP6: Change state to REQEST when any IA has NOBINDING status

Just to be more RFC conformant.

6 years agoFix a memory NULL deference when freeing static routes at exit.
Roy Marples [Sun, 28 Jul 2019 20:14:41 +0000 (21:14 +0100)] 
Fix a memory NULL deference when freeing static routes at exit.

This is less effort than changing the options API to work with
an interface object rather than an interface name.

6 years agoSolaris: Avoid re-adding IPv6 addresses to preserve the prefix route
Roy Marples [Sun, 28 Jul 2019 16:10:36 +0000 (16:10 +0000)] 
Solaris: Avoid re-adding IPv6 addresses to preserve the prefix route

Really, kernels should just stop doing this, it's pointless.

6 years agoRework prior again so we log the address in debug.
Roy Marples [Sun, 28 Jul 2019 14:56:41 +0000 (15:56 +0100)] 
Rework prior again so we log the address in debug.

6 years agoFix compile issue with prior.
Roy Marples [Sun, 28 Jul 2019 14:41:07 +0000 (15:41 +0100)] 
Fix compile issue with prior.

6 years agoIP: If no address lifetime support don't re-add the address
Roy Marples [Sun, 28 Jul 2019 14:37:05 +0000 (15:37 +0100)] 
IP: If no address lifetime support don't re-add the address

Unless we need to. If we do, there is a chance that the OS
will scrub the subnet route and re-add it. We want to avoid
this as it's likely in use.

6 years agoDHCP: Avoid duplicate read of packet
Roy Marples [Sun, 28 Jul 2019 13:27:24 +0000 (14:27 +0100)] 
DHCP: Avoid duplicate read of packet

If the BPF socket is open, discard any read from UDP as it
would be duplicated.

6 years agoconfigure: Fix test for open_memstream
Roy Marples [Sun, 28 Jul 2019 11:53:03 +0000 (12:53 +0100)] 
configure: Fix test for open_memstream

glibc-2.19 needs the return value testing....

6 years agoscript: ensure that tmp files are removed
Roy Marples [Sun, 28 Jul 2019 10:49:17 +0000 (11:49 +0100)] 
script: ensure that tmp files are removed

fopen creates a new stream which will use a new fd.
Why using fdopen, the new stream will use the same fd, so when
it's closed the tmp file will really unlink.

6 years agoUpdate comment
Roy Marples [Thu, 25 Jul 2019 17:58:18 +0000 (18:58 +0100)] 
Update comment

6 years agoMention 29-lookup-hostname rather than 10-wpa_supplicant
Roy Marples [Thu, 25 Jul 2019 17:49:13 +0000 (18:49 +0100)] 
Mention 29-lookup-hostname rather than 10-wpa_supplicant

As the wpa_supplicant hook script is obsolete when using
wpa_suppliant-2.6 or newer build with CONFIG_MATCH_IFACE.

6 years agoFix define for prior
Roy Marples [Thu, 25 Jul 2019 16:31:02 +0000 (17:31 +0100)] 
Fix define for prior

6 years agoRemove ND6 Advertisement from SMALL builds.
Roy Marples [Thu, 25 Jul 2019 16:20:41 +0000 (17:20 +0100)] 
Remove ND6 Advertisement from SMALL builds.

This is quite a saving and is only used for IP6 address sharing
which only works on NetBSD.

6 years agoNetBSD: Allow dhcpcd to be built without ARP support
Roy Marples [Thu, 25 Jul 2019 15:27:09 +0000 (16:27 +0100)] 
NetBSD: Allow dhcpcd to be built without ARP support

Because NetBSD has RFC 5227 support in the kernel, we only need
ARP to announce addresses and we only need to do that when
address sharing which shouldn't be a concern for small
installations where size is paramount.

6 years agoRelease dhcpcd-8.0.1 v8.0.1
Roy Marples [Thu, 25 Jul 2019 08:37:10 +0000 (09:37 +0100)] 
Release dhcpcd-8.0.1

6 years agoFix compile on NetBSD with ARP but not ARPING
Roy Marples [Wed, 24 Jul 2019 23:06:36 +0000 (00:06 +0100)] 
Fix compile on NetBSD with ARP but not ARPING

6 years agoFix compile on Linux without ARPING
Roy Marples [Wed, 24 Jul 2019 19:16:27 +0000 (20:16 +0100)] 
Fix compile on Linux without ARPING

6 years agoFree script buffers before exiting from a fork.
Roy Marples [Wed, 24 Jul 2019 18:53:10 +0000 (19:53 +0100)] 
Free script buffers before exiting from a fork.

6 years agoFix build without INET.
Roy Marples [Wed, 24 Jul 2019 18:42:00 +0000 (19:42 +0100)] 
Fix build without INET.

6 years agoFix build without ARP and/or ARPING
Roy Marples [Wed, 24 Jul 2019 18:33:10 +0000 (19:33 +0100)] 
Fix build without ARP and/or ARPING

6 years agoFix compile without IPv4LL
Roy Marples [Wed, 24 Jul 2019 18:21:45 +0000 (19:21 +0100)] 
Fix compile without IPv4LL

6 years agoIPv4LL: Work once more on NetBSD
Roy Marples [Wed, 24 Jul 2019 18:12:24 +0000 (19:12 +0100)] 
IPv4LL: Work once more on NetBSD

6 years agoFix SMALL build.
Roy Marples [Wed, 24 Jul 2019 15:06:51 +0000 (16:06 +0100)] 
Fix SMALL build.

6 years agoRelease dhcpcd-8.0.0 v8.0.0
Roy Marples [Wed, 24 Jul 2019 09:32:21 +0000 (10:32 +0100)] 
Release dhcpcd-8.0.0

6 years agoBSD: Work around another coverity false positive.
Roy Marples [Tue, 23 Jul 2019 16:20:35 +0000 (17:20 +0100)] 
BSD: Work around another coverity false positive.

6 years agoTypo
Roy Marples [Tue, 23 Jul 2019 15:23:27 +0000 (16:23 +0100)] 
Typo

6 years agoLinux: Mark another coverity false positive.
Roy Marples [Tue, 23 Jul 2019 15:11:18 +0000 (16:11 +0100)] 
Linux: Mark another coverity false positive.

6 years agoinet: Don't lose the host route needed for the router
Roy Marples [Tue, 23 Jul 2019 14:55:27 +0000 (15:55 +0100)] 
inet: Don't lose the host route needed for the router

6 years agoLinux: Work around a coverity issue
Roy Marples [Tue, 23 Jul 2019 14:27:48 +0000 (15:27 +0100)] 
Linux: Work around a coverity issue

sa points to a struct sockaddr inside a union where the
biggest member os sockaddr_in6.
We cast sa to char *, and then write to the address offset
directly which will go beyond a sockaddr if we're writing
a sockaddr_in6 - but this is fine, the union caters for it.

6 years agodhcpcd: Don't leak resources if we can't find a newly added interface
Roy Marples [Tue, 23 Jul 2019 13:56:49 +0000 (14:56 +0100)] 
dhcpcd: Don't leak resources if we can't find a newly added interface

6 years agodhcpcd: Don't leak memory when routing socket overflows
Roy Marples [Tue, 23 Jul 2019 13:53:01 +0000 (14:53 +0100)] 
dhcpcd: Don't leak memory when routing socket overflows

6 years agoChange prior to be non-fatal
Roy Marples [Tue, 23 Jul 2019 13:33:14 +0000 (14:33 +0100)] 
Change prior to be non-fatal

6 years agoLinux: Care about the return of setsockopt
Roy Marples [Tue, 23 Jul 2019 13:31:07 +0000 (14:31 +0100)] 
Linux: Care about the return of setsockopt

6 years agoDHCP: On ARP duplication, ensure the interface pointer is valid
Roy Marples [Tue, 23 Jul 2019 13:26:53 +0000 (14:26 +0100)] 
DHCP: On ARP duplication, ensure the interface pointer is valid

6 years agologerr: Care about fprintf return codes
Roy Marples [Tue, 23 Jul 2019 13:23:11 +0000 (14:23 +0100)] 
logerr: Care about fprintf return codes

Abort early if an error and return the overall result if we ever
need it.

6 years agoOpenBSD: Fix compile.
Roy Marples [Mon, 22 Jul 2019 15:19:27 +0000 (16:19 +0100)] 
OpenBSD: Fix compile.

6 years agoCast time_t to long long to satisfy printf.
Roy Marples [Mon, 22 Jul 2019 15:12:53 +0000 (16:12 +0100)] 
Cast time_t to long long to satisfy printf.

There is no standard primitive for it.

6 years agoRemove fcntl.h from here.
Roy Marples [Mon, 22 Jul 2019 14:59:37 +0000 (15:59 +0100)] 
Remove fcntl.h from here.

6 years agoUse rebindtime rather than renewaltime.
Roy Marples [Mon, 22 Jul 2019 13:41:05 +0000 (14:41 +0100)] 
Use rebindtime rather than renewaltime.

6 years agoDHCP: Always add the leased address
Roy Marples [Mon, 22 Jul 2019 12:34:10 +0000 (13:34 +0100)] 
DHCP: Always add the leased address

This is needed so that the lifetimes are refreshed.
While here, set the pltime to the renewal time.

6 years agoDHCP6: Assert auto sla is only 32-bits
Roy Marples [Mon, 22 Jul 2019 11:44:20 +0000 (12:44 +0100)] 
DHCP6: Assert auto sla is only 32-bits

It already is due to the use of fls32 above, but this assertion
makes clang static analyser happy.

6 years agooptions: Fix a static analysis error
Roy Marples [Mon, 22 Jul 2019 10:49:54 +0000 (11:49 +0100)] 
options: Fix a static analysis error

Can't actually happen because the string doesn't change and the
result is already checked above. However, it's pretty harmless to
add.

6 years agoFix prior
Roy Marples [Mon, 22 Jul 2019 10:38:10 +0000 (11:38 +0100)] 
Fix prior

6 years agooptions: Fix a potential memory leak
Roy Marples [Mon, 22 Jul 2019 10:20:27 +0000 (11:20 +0100)] 
options: Fix a potential memory leak

6 years agoFix compile issue with prior
Roy Marples [Mon, 22 Jul 2019 09:41:16 +0000 (10:41 +0100)] 
Fix compile issue with prior

6 years agoDHCP: Set address vltime and pltime to the length of the lease
Roy Marples [Mon, 22 Jul 2019 09:37:13 +0000 (10:37 +0100)] 
DHCP: Set address vltime and pltime to the length of the lease

The only OS which supports this is Linux, but more importantly it
will report the address as "dynamic" so that users can distinguish
it from statically added addresses.

6 years agoarp: Fix a crash when dhcpcd forks or an interface removed
Roy Marples [Tue, 16 Jul 2019 09:53:35 +0000 (10:53 +0100)] 
arp: Fix a crash when dhcpcd forks or an interface removed

Because we try and free the ARP state when dhcpcd forks or an
interface is removed, the loop to work out the next state to free
could return invalid memory.
So test we have an ARP state each time we iterate and free.

6 years agoroute: Compare AF_UNSPEC family when cleaning old routes
Roy Marples [Mon, 15 Jul 2019 16:13:43 +0000 (17:13 +0100)] 
route: Compare AF_UNSPEC family when cleaning old routes

6 years agohooks: Ensure header is empty before populating it.
Roy Marples [Fri, 12 Jul 2019 14:04:13 +0000 (15:04 +0100)] 
hooks: Ensure header is empty before populating it.

Thanks to Andreas

6 years ago10-wpa_supplicant: Correct stop diagnostic
Roy Marples [Tue, 9 Jul 2019 09:27:38 +0000 (10:27 +0100)] 
10-wpa_supplicant: Correct stop diagnostic

6 years agoMerge branch 'memstream'
Roy Marples [Thu, 4 Jul 2019 11:22:46 +0000 (12:22 +0100)] 
Merge branch 'memstream'

6 years agoAdd SPDX identifiers to all dhcpcd source files.
Yegor Yefremov [Thu, 4 Jul 2019 11:18:28 +0000 (12:18 +0100)] 
Add SPDX identifiers to all dhcpcd source files.
See https://spdx.org/ for details.

6 years agoMerge pull request #7 from sashko/master
Roy Marples [Tue, 25 Jun 2019 21:31:02 +0000 (22:31 +0100)] 
Merge pull request #7 from sashko/master

Fix typo in configure

6 years agoFix typo in configure
Oleksandr Kravchuk [Tue, 25 Jun 2019 20:28:35 +0000 (22:28 +0200)] 
Fix typo in configure

6 years agoDHCP6: Fix INFORM support
Roy Marples [Thu, 20 Jun 2019 15:44:21 +0000 (16:44 +0100)] 
DHCP6: Fix INFORM support

6 years agoscript: enable if_ssid again
Roy Marples [Wed, 19 Jun 2019 20:33:57 +0000 (21:33 +0100)] 
script: enable if_ssid again

6 years agoscript: Fix a memory error
Roy Marples [Wed, 19 Jun 2019 17:59:44 +0000 (18:59 +0100)] 
script: Fix a memory error

6 years agoND: Ensure that ltime is always set
Roy Marples [Wed, 19 Jun 2019 10:42:30 +0000 (10:42 +0000)] 
ND: Ensure that ltime is always set

6 years agoRemove now unused variables.
Roy Marples [Wed, 19 Jun 2019 10:41:06 +0000 (10:41 +0000)] 
Remove now unused variables.

6 years agoMerge branch 'master' into memstream
Roy Marples [Tue, 18 Jun 2019 16:37:04 +0000 (17:37 +0100)] 
Merge branch 'master' into memstream

6 years agoroute: Build list of static routes and routers correctly.
Roy Marples [Tue, 18 Jun 2019 16:35:23 +0000 (17:35 +0100)] 
route: Build list of static routes and routers correctly.

They they need to be inserted by rt_proto_add().

6 years agoscript: Write variables to a FILE
Roy Marples [Tue, 18 Jun 2019 10:33:53 +0000 (11:33 +0100)] 
script: Write variables to a FILE

Each variable is NULL terminated inside the file just like the
control stream which saves us from having to flatten it when
writing to the control stream.
Once written, create env pointers to the start of each string
just after the NULL terminator.

This also means that we just need to free two buffers when
dhcpcd exits (FILE buffer and env buffer) rather than each variable
individually.

If open_memstream(3) is not supported by libc then dhcpcd will
write to a file in /tmp instead.

6 years agoRA: expire whole RA on carrier up
Roy Marples [Fri, 14 Jun 2019 16:05:24 +0000 (17:05 +0100)] 
RA: expire whole RA on carrier up

If preserving IP, we need to expire the whole RA now that we care
about RDNSS and DNSSL lifetimes. Cheat by setting the aquired time
to something very low so it all expires.

6 years agoarp: announce address from most preferred interface
Roy Marples [Fri, 14 Jun 2019 16:03:55 +0000 (17:03 +0100)] 
arp: announce address from most preferred interface

Now we no longer sort interfaces, this is needed.

6 years agoMerge branch 'master' into rbtree
Roy Marples [Fri, 14 Jun 2019 14:22:43 +0000 (15:22 +0100)] 
Merge branch 'master' into rbtree

6 years agodhcpcd: don't expire RA on carrier down when when preserving IP
Roy Marples [Fri, 14 Jun 2019 13:49:01 +0000 (14:49 +0100)] 
dhcpcd: don't expire RA on carrier down when when preserving IP

6 years agoRA: expire RDNSS and DNSSL entries
Roy Marples [Fri, 14 Jun 2019 12:53:51 +0000 (13:53 +0100)] 
RA: expire RDNSS and DNSSL entries

This allows us to remember N fully expired RA's which works around
an obscure issue where a received RA has no lifetime or any
prefixes with lifetimes but does have an instruction to start DHCP6.

It was harmless but filled the log with spam and now there is no
log spam!

6 years agoMerge pull request #6 from DanielG/master
Roy Marples [Wed, 12 Jun 2019 18:44:16 +0000 (19:44 +0100)] 
Merge pull request #6 from DanielG/master

30-hostname: Fix typo: hsort -> hshort

6 years ago30-hostname: Fix typo: hsort -> hshort
Daniel Gröber [Wed, 12 Jun 2019 17:59:53 +0000 (19:59 +0200)] 
30-hostname: Fix typo: hsort -> hshort

6 years agoDHCP6: Keep running regardless of RA state
Roy Marples [Wed, 12 Jun 2019 12:43:27 +0000 (13:43 +0100)] 
DHCP6: Keep running regardless of RA state

We should keep DHCP6 running even if routers expire or link changes.
This is noted in RFC3315 18.1.2:
   If the client receives no responses before the message transmission
   process terminates, as described in section 14, the client SHOULD
   continue to use any IP addresses, using the last known
   lifetimes for those addresses, and SHOULD continue to use any other
   previously obtained configuration parameters.

6 years agoFix a gcc warning about signed overflow
Roy Marples [Fri, 7 Jun 2019 16:15:00 +0000 (17:15 +0100)] 
Fix a gcc warning about signed overflow

6 years agoroute: Compile on older BSD platforms
Roy Marples [Fri, 7 Jun 2019 15:59:41 +0000 (16:59 +0100)] 
route: Compile on older BSD platforms

6 years agoroute: Use order from message / config
Roy Marples [Fri, 7 Jun 2019 15:37:00 +0000 (16:37 +0100)] 
route: Use order from message / config

We can't just make the order up as that is prone to error.
So apply ordering as from the source.

6 years agolinux: use correct prototype
Roy Marples [Sun, 5 May 2019 18:04:02 +0000 (19:04 +0100)] 
linux: use correct prototype

6 years agosun: Use sa_len rather than our variant.
Roy Marples [Sun, 5 May 2019 11:54:45 +0000 (11:54 +0000)] 
sun: Use sa_len rather than our variant.

6 years agosa: Fix compile on non BSD
Roy Marples [Sun, 5 May 2019 11:54:30 +0000 (11:54 +0000)] 
sa: Fix compile on non BSD

6 years agoroute: Fix OS route comparison
Roy Marples [Sun, 5 May 2019 11:47:54 +0000 (12:47 +0100)] 
route: Fix OS route comparison

This at least works on a multi-homed NetBSD.

6 years agosa: Ensure sa_addrtop has a buffer to write to
Roy Marples [Sun, 5 May 2019 11:46:32 +0000 (12:46 +0100)] 
sa: Ensure sa_addrtop has a buffer to write to

While here, if sa_family is AF_UNSPEC print a blank string.

6 years agosa: Add sa_len() to calculate sockaddr length for non BSD
Roy Marples [Sun, 5 May 2019 11:45:29 +0000 (12:45 +0100)] 
sa: Add sa_len() to calculate sockaddr length for non BSD

6 years agoroute: Fix stamping on existing kernel routes
Roy Marples [Sat, 4 May 2019 18:38:44 +0000 (19:38 +0100)] 
route: Fix stamping on existing kernel routes

6 years agoFix compile.
Roy Marples [Sat, 4 May 2019 10:07:18 +0000 (11:07 +0100)] 
Fix compile.

6 years agoMerge branch 'master' into rbtree
Roy Marples [Sat, 4 May 2019 10:05:17 +0000 (11:05 +0100)] 
Merge branch 'master' into rbtree

6 years agoMerge branch 'dhcpcd-7'
Roy Marples [Sat, 4 May 2019 09:54:00 +0000 (10:54 +0100)] 
Merge branch 'dhcpcd-7'

6 years agoDHCPv6: Fix exclude prefix length check. v7.2.2
Roy Marples [Sat, 4 May 2019 09:19:02 +0000 (10:19 +0100)] 
DHCPv6: Fix exclude prefix length check.

6 years agoRelease dhcpcd-7.2.2
Roy Marples [Sat, 4 May 2019 08:41:16 +0000 (09:41 +0100)] 
Release dhcpcd-7.2.2

6 years agosun: More validation around route messages
Roy Marples [Sat, 4 May 2019 08:17:01 +0000 (08:17 +0000)] 
sun: More validation around route messages

6 years agosun: Apply same RTM validation from BSD
Roy Marples [Fri, 3 May 2019 15:44:13 +0000 (15:44 +0000)] 
sun: Apply same RTM validation from BSD

6 years agoBSD: Ignore coverity errors
Roy Marples [Fri, 3 May 2019 15:27:35 +0000 (16:27 +0100)] 
BSD: Ignore coverity errors

We could do ((char *)rtm) + rtm->rtm_msglen but that looks
more ugly than rtm + 1.

6 years agoBSD: Validate RTM message lengths received
Roy Marples [Fri, 3 May 2019 14:44:51 +0000 (15:44 +0100)] 
BSD: Validate RTM message lengths received

Doubtful these lengths would be invalid, but you never know.

6 years agoBPF: Fix ARP BPF filter to actually filter unwanted ARP message types
Roy Marples [Fri, 3 May 2019 13:50:28 +0000 (14:50 +0100)] 
BPF: Fix ARP BPF filter to actually filter unwanted ARP message types

While here, clarify the BPF instruction space needed for ARP as it
could overflow in the very unlikely event we ARP for three
addresses at the same time.

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

6 years agoFix a small brain fart causing LINK_UNKNOWN to spin.
Roy Marples [Thu, 2 May 2019 20:48:52 +0000 (21:48 +0100)] 
Fix a small brain fart causing LINK_UNKNOWN to spin.

6 years agoBSD: Simplify carrier detection once more.
Roy Marples [Thu, 2 May 2019 20:25:57 +0000 (21:25 +0100)] 
BSD: Simplify carrier detection once more.

RTM_IFINFO messages now send the un-molested link status to
the main carrier handler which no longer polls on LINK_UNKNOWN.
Instead, we check carrier status directly, which if unsupported
we instead interface flags.

This is 2019, all interface drivers should report link status
correctly via RTM_IFINFO messages and trying to constantly work
around this is error prone and time consuming.

6 years agoFix comment
Roy Marples [Thu, 2 May 2019 12:06:44 +0000 (13:06 +0100)] 
Fix comment

6 years agoBSD: RTM_IFINFO is not emitted for all interfaces past unknown link
Roy Marples [Thu, 2 May 2019 12:02:36 +0000 (13:02 +0100)] 
BSD: RTM_IFINFO is not emitted for all interfaces past unknown link

It has to work for wireless interfaces, but we have no idea
about other interfaces. So test valid carrier for unknown.

6 years agoDon't report errno here.
Roy Marples [Mon, 29 Apr 2019 17:40:13 +0000 (18:40 +0100)] 
Don't report errno here.

6 years agodhcp: Cast away a warning on mips64
Roy Marples [Mon, 29 Apr 2019 16:36:21 +0000 (17:36 +0100)] 
dhcp: Cast away a warning on mips64