]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
7 years agoDHCPv6: Transpose DHCP userclass option into DHCPv6
Roy Marples [Tue, 17 Apr 2018 10:36:32 +0000 (11:36 +0100)] 
DHCPv6: Transpose DHCP userclass option into DHCPv6

7 years agoLinux: If listening to dev manager, let it remove interfaces
Roy Marples [Mon, 16 Apr 2018 09:23:30 +0000 (09:23 +0000)] 
Linux: If listening to dev manager, let it remove interfaces

Otherwise we race with the kernel removing and the dev manager
re-adding it.

7 years agoBSD: move the interface hint up the stack
Roy Marples [Mon, 16 Apr 2018 08:37:04 +0000 (09:37 +0100)] 
BSD: move the interface hint up the stack

This probably isn't needed, but allows us to hint the interface
when not directly setting IFP.

7 years agoLinux: Improve interface renaming
Roy Marples [Sun, 15 Apr 2018 13:36:36 +0000 (13:36 +0000)] 
Linux: Improve interface renaming

7 years agoOpenBSD: Fix adding INET6 on-link routes without an address
Roy Marples [Sun, 15 Apr 2018 13:23:49 +0000 (14:23 +0100)] 
OpenBSD: Fix adding INET6 on-link routes without an address

7 years agoOpenBSD: Remove more route labelling
Roy Marples [Sun, 15 Apr 2018 09:54:10 +0000 (10:54 +0100)] 
OpenBSD: Remove more route labelling

7 years agoRelease dhcpcd-7.0.3 v7.0.3
Roy Marples [Fri, 6 Apr 2018 10:28:57 +0000 (11:28 +0100)] 
Release dhcpcd-7.0.3

7 years agodhcp: mark routes needed dhcpcd adds to reach router as host routes
Roy Marples [Thu, 5 Apr 2018 13:22:39 +0000 (13:22 +0000)] 
dhcp: mark routes needed dhcpcd adds to reach router as host routes

This is mainly a cosmetic change.

7 years agoroutes: free optional routes at exit before the global free list.
Roy Marples [Wed, 28 Mar 2018 18:31:02 +0000 (18:31 +0000)] 
routes: free optional routes at exit before the global free list.

7 years agoroutes: allow a head clear with a context
Roy Marples [Wed, 28 Mar 2018 18:25:16 +0000 (18:25 +0000)] 
routes: allow a head clear with a context

This is because optionally defined routes may not have an interface
at the global level.
Also, init route lists earlier so they can be freed without error.

7 years agooptions: allow static routes to be configured on the command line
Roy Marples [Wed, 28 Mar 2018 10:00:18 +0000 (11:00 +0100)] 
options: allow static routes to be configured on the command line

7 years agodhcp6: fix a potential string termination error on status messages
Roy Marples [Tue, 27 Mar 2018 23:22:01 +0000 (00:22 +0100)] 
dhcp6: fix a potential string termination error on status messages

7 years agoBSD: fix segfault when on carrier when IPv6 addresses are present
Roy Marples [Tue, 27 Mar 2018 22:06:30 +0000 (23:06 +0100)] 
BSD: fix segfault when on carrier when IPv6 addresses are present

This doesn't affect NetBSD.

7 years agoudev: Use our logerr framework instead of syslog(3)
Roy Marples [Tue, 27 Mar 2018 07:52:25 +0000 (07:52 +0000)] 
udev: Use our logerr framework instead of syslog(3)

7 years agovanity: space out config.h a bit better
Roy Marples [Tue, 27 Mar 2018 06:23:31 +0000 (07:23 +0100)] 
vanity: space out config.h a bit better

7 years agoRelease dhcpcd-7.0.2 v7.0.2
Roy Marples [Tue, 27 Mar 2018 05:45:24 +0000 (06:45 +0100)] 
Release dhcpcd-7.0.2

7 years agoReally start dhcp on deletion of address.
Roy Marples [Thu, 22 Mar 2018 19:18:03 +0000 (19:18 +0000)] 
Really start dhcp on deletion of address.

7 years agoFor IPv4, override any existing address when adding it.
Roy Marples [Thu, 22 Mar 2018 18:22:04 +0000 (18:22 +0000)] 
For IPv4, override any existing address when adding it.
When deleting stale addresses, report our pid as the deletor.

7 years agoIf the DHCP leased address is deleted, enter the reboot phase.
Roy Marples [Thu, 22 Mar 2018 18:21:46 +0000 (18:21 +0000)] 
If the DHCP leased address is deleted, enter the reboot phase.

7 years agoThis should be an error.
Roy Marples [Thu, 22 Mar 2018 18:20:56 +0000 (18:20 +0000)] 
This should be an error.

7 years agoFree ARP state when the address is deleted.
Roy Marples [Thu, 22 Mar 2018 18:20:06 +0000 (18:20 +0000)] 
Free ARP state when the address is deleted.

7 years agoFix compile on OpenBSD.
Roy Marples [Mon, 19 Mar 2018 20:56:42 +0000 (20:56 +0000)] 
Fix compile on OpenBSD.

7 years agoTest for ENOMEM as well.
Roy Marples [Mon, 19 Mar 2018 17:26:15 +0000 (17:26 +0000)] 
Test for ENOMEM as well.

7 years agolink: detect buffer overflow / desync and relearn interface state
Roy Marples [Mon, 19 Mar 2018 15:39:05 +0000 (15:39 +0000)] 
link: detect buffer overflow / desync and relearn interface state

It's possible for the internal kernel buffer that reports network
events to overflow.
On Linux and NetBSD* this is handled by ENOBUFS being returned
by recv(2). On OpenBSD there is a special route(4) message RTM_DESYNC.
All other OS's don't seem to report this error, so dhcpcd cannot
detect it.

* I will commit a patch to NetBSD soon for this and will request a
pullup to NetBSD-8.

7 years agoipv6nd: simplify reachable
Roy Marples [Thu, 15 Mar 2018 20:31:14 +0000 (20:31 +0000)] 
ipv6nd: simplify reachable

7 years agodhcp6: deny unicast in non master mode
Roy Marples [Sat, 10 Mar 2018 11:50:08 +0000 (11:50 +0000)] 
dhcp6: deny unicast in non master mode

It seems that some DHCP6 servers or firewalls really insist on the
client sending from the correct source port.
This is the safest thing for the time being.

7 years agoLog the pid of the process deleting an assigned address.
Roy Marples [Tue, 6 Mar 2018 08:55:11 +0000 (08:55 +0000)] 
Log the pid of the process deleting an assigned address.

This should make debugging easier with third party software.

7 years agoipv6nd: drop DHCPv6 when RA fully expires
Roy Marples [Fri, 2 Mar 2018 15:00:07 +0000 (15:00 +0000)] 
ipv6nd: drop DHCPv6 when RA fully expires

Fixes an error where RA addresses would expire but the DHCPv6
lease still persisted.

7 years agodhcp6: don't drop when still asking for delegation
Roy Marples [Fri, 2 Mar 2018 13:58:52 +0000 (13:58 +0000)] 
dhcp6: don't drop when still asking for delegation

7 years agoinet6: remove references to the crazies.
Roy Marples [Sun, 25 Feb 2018 16:31:23 +0000 (16:31 +0000)] 
inet6: remove references to the crazies.

And add a comment that if we do this again to add a new knob for it.

7 years agoSpelling
Roy Marples [Tue, 20 Feb 2018 09:08:02 +0000 (09:08 +0000)] 
Spelling

7 years agohooks: document that hooks are not run within their own process
Roy Marples [Tue, 20 Feb 2018 09:06:38 +0000 (09:06 +0000)] 
hooks: document that hooks are not run within their own process

7 years agodhcpcd: Don't report errno when aborting here.
Roy Marples [Tue, 20 Feb 2018 08:36:53 +0000 (08:36 +0000)] 
dhcpcd: Don't report errno when aborting here.

7 years agoif-linux: if_setup_inet6 is called once so remove local ifname
Roy Marples [Tue, 20 Feb 2018 08:25:59 +0000 (08:25 +0000)] 
if-linux: if_setup_inet6 is called once so remove local ifname

7 years agodhcp: reset interval during init
Roy Marples [Tue, 13 Feb 2018 10:33:06 +0000 (10:33 +0000)] 
dhcp: reset interval during init

This fixes NetBSD where the lease is persisted at carrier down.
When the carrier comes back up again we need the interval
to reset to zero so that DHCP happens quicker.

7 years agoAdd support for setproctitle(3).
Roy Marples [Tue, 13 Feb 2018 10:22:31 +0000 (10:22 +0000)] 
Add support for setproctitle(3).

7 years agoWhitespace.
Roy Marples [Sat, 10 Feb 2018 20:52:31 +0000 (20:52 +0000)] 
Whitespace.

7 years agoFix compile on IllumOS.
Roy Marples [Fri, 2 Feb 2018 16:39:03 +0000 (16:39 +0000)] 
Fix compile on IllumOS.

7 years agoSatisfy FreeBSD and NetBSD.
Roy Marples [Fri, 2 Feb 2018 16:35:38 +0000 (16:35 +0000)] 
Satisfy FreeBSD and NetBSD.

7 years agoFix compile on FreeBSD.
Roy Marples [Fri, 2 Feb 2018 16:28:31 +0000 (16:28 +0000)] 
Fix compile on FreeBSD.

7 years agoinet6: simplify setup of kernel
Roy Marples [Fri, 2 Feb 2018 11:24:58 +0000 (11:24 +0000)] 
inet6: simplify setup of kernel

Rename if_checkipv6 to if_setup_inet6 so it's more descriptive.
simpify code as we don't really care about the result.
Restore the prior behavior of not disabling kernel RA handling
if dhcpcd is not doing it.

7 years agoRelease dhcpcd-7.0.1 v7.0.1
Roy Marples [Mon, 29 Jan 2018 10:53:05 +0000 (10:53 +0000)] 
Release dhcpcd-7.0.1

7 years agodhcpcd-run-hooks: set vars to blank
Roy Marples [Sat, 20 Jan 2018 20:37:48 +0000 (20:37 +0000)] 
dhcpcd-run-hooks: set vars to blank

7 years agodhcpcd-run-hooks: POSIX shell does not require the local builtin
Roy Marples [Sat, 20 Jan 2018 20:28:20 +0000 (20:28 +0000)] 
dhcpcd-run-hooks: POSIX shell does not require the local builtin

And sadly some ksh variants don't support it.
As dhcpcd strives to be portable, stop using local.

7 years agoRemove unused variable.
Roy Marples [Sat, 20 Jan 2018 17:16:25 +0000 (17:16 +0000)] 
Remove unused variable.

7 years agoRemove now unused sysloglike define.
Roy Marples [Tue, 16 Jan 2018 17:27:49 +0000 (17:27 +0000)] 
Remove now unused sysloglike define.

7 years agoMerge pull request #1 from chathhorn/patch-1
Roy Marples [Tue, 16 Jan 2018 17:17:47 +0000 (17:17 +0000)] 
Merge pull request #1 from chathhorn/patch-1

Fix build issue when `__GNUC__ <= 2`

7 years agoFix build issue when `__GNUC__ <= 2`
Chris Hathhorn [Tue, 16 Jan 2018 16:45:04 +0000 (10:45 -0600)] 
Fix build issue when `__GNUC__ <= 2`

The `__printflike` macro appears to take two arguments.

7 years agodhcpcd: don't log errors working out carrier for departed interfaces
Roy Marples [Thu, 11 Jan 2018 11:21:08 +0000 (11:21 +0000)] 
dhcpcd: don't log errors working out carrier for departed interfaces

7 years agoBump date for man updates.
Roy Marples [Mon, 8 Jan 2018 10:24:16 +0000 (10:24 +0000)] 
Bump date for man updates.

7 years agoRemove no longer needed active check from prior commit.
Roy Marples [Mon, 8 Jan 2018 09:29:51 +0000 (09:29 +0000)] 
Remove no longer needed active check from prior commit.

7 years agoipv4: allow configuration of static broadcast address
Roy Marples [Mon, 8 Jan 2018 09:25:31 +0000 (09:25 +0000)] 
ipv4: allow configuration of static broadcast address

7 years agoif: don't set MTU during interface discovery
Roy Marples [Sun, 7 Jan 2018 18:37:50 +0000 (18:37 +0000)] 
if: don't set MTU during interface discovery

7 years agodhcp: don't loop needlessly when handling an interface
Roy Marples [Sun, 7 Jan 2018 17:46:56 +0000 (17:46 +0000)] 
dhcp: don't loop needlessly when handling an interface

7 years agoif: don't activate non matching interfaces to commandline ones
Roy Marples [Sun, 7 Jan 2018 17:41:27 +0000 (17:41 +0000)] 
if: don't activate non matching interfaces to commandline ones

7 years agoconfigure: make --includedir=/usr/src/foo work
Roy Marples [Sun, 7 Jan 2018 13:24:21 +0000 (13:24 +0000)] 
configure: make --includedir=/usr/src/foo work

7 years agoeloop-bench: use calloc
Roy Marples [Fri, 5 Jan 2018 19:07:35 +0000 (19:07 +0000)] 
eloop-bench: use calloc

7 years agoeloop-bench: fix reading the last write
Roy Marples [Fri, 5 Jan 2018 17:29:27 +0000 (17:29 +0000)] 
eloop-bench: fix reading the last write

The last write was never read from the pipe in the run, so many
runs filled the kernel buffer causing an error which was not seen
because the pipe was blocking.

Set the pipes to non blocking and improve the exit conditions,
also ensuring the bench returns any error back.
While here add more timings and run critera.

Thanks to Christos Zoulas for helping.

7 years agodhcp: don't bind when we've just probed an address to inform
Roy Marples [Tue, 2 Jan 2018 16:36:04 +0000 (16:36 +0000)] 
dhcp: don't bind when we've just probed an address to inform

This fixes an early fork issue.

7 years agoRelease dhcpcd-7.0.0 v7.0.0
Roy Marples [Mon, 1 Jan 2018 11:17:56 +0000 (11:17 +0000)] 
Release dhcpcd-7.0.0

7 years agoWelcome to 2018.
Roy Marples [Mon, 1 Jan 2018 11:17:24 +0000 (11:17 +0000)] 
Welcome to 2018.

7 years agohooks: set protocol to link for link layer events
Roy Marples [Tue, 12 Dec 2017 14:32:48 +0000 (14:32 +0000)] 
hooks: set protocol to link for link layer events

7 years agoipv6: disable kernel RA if interface is active
Roy Marples [Tue, 12 Dec 2017 13:38:43 +0000 (13:38 +0000)] 
ipv6: disable kernel RA if interface is active

7 years agolinux: use IFA_F_NOPREFIXROUTE for ipv4 addresses
Roy Marples [Sun, 10 Dec 2017 18:49:20 +0000 (18:49 +0000)] 
linux: use IFA_F_NOPREFIXROUTE for ipv4 addresses

7 years agodhcp6: fix prefix delegations from spamming syslog
Roy Marples [Fri, 8 Dec 2017 10:29:49 +0000 (10:29 +0000)] 
dhcp6: fix prefix delegations from spamming syslog

This test was broken because pdp.vltime was already converted from
network order to host order.

7 years agobsd: set sa_len
Roy Marples [Thu, 7 Dec 2017 21:12:43 +0000 (21:12 +0000)] 
bsd: set sa_len

7 years agodhcp: set probe state only when probing.
Roy Marples [Thu, 7 Dec 2017 20:44:13 +0000 (20:44 +0000)] 
dhcp: set probe state only when probing.

This fixes the REBIND reason.

7 years agodhcp6: Free any existing new state
Roy Marples [Thu, 7 Dec 2017 18:33:20 +0000 (18:33 +0000)] 
dhcp6: Free any existing new state

This can happen on any OS in the case of an ARP conflict which
triggers dhcpcd to potentially change profile and DHCP6 options.

7 years agodhcp6: don't listen on IPv6 addresses when not using DHCP6
Roy Marples [Thu, 7 Dec 2017 17:01:39 +0000 (17:01 +0000)] 
dhcp6: don't listen on IPv6 addresses when not using DHCP6

To achieve this we need to learn the addresses AFTER the interface
configuration has been loaded.

7 years agodhcp: Don't set ciaddr or unicast if the address we have is faked.
Roy Marples [Thu, 7 Dec 2017 15:15:45 +0000 (15:15 +0000)] 
dhcp: Don't set ciaddr or unicast if the address we have is faked.

7 years agodhcp: when unicasting, don't use a L2 broadcast
Roy Marples [Thu, 7 Dec 2017 15:12:18 +0000 (15:12 +0000)] 
dhcp: when unicasting, don't use a L2 broadcast

This relies change now relies on the kernel supporting IP_PKTINFO
to select the correct outbound interface which may not
always be the case due to routing.

7 years agoRelease dhcpcd-7.0.0-rc4 v7.0.0-rc4
Roy Marples [Wed, 6 Dec 2017 09:44:26 +0000 (09:44 +0000)] 
Release dhcpcd-7.0.0-rc4

7 years agoeloop: set _eloop in signal setup rather than start
Roy Marples [Wed, 15 Nov 2017 15:14:24 +0000 (15:14 +0000)] 
eloop: set _eloop in signal setup rather than start

This fixes a potential issue where a signal could be received
before eloop_start is called.

7 years agoInit the signal handler ASAP so random stuff can be cleaned up.
Roy Marples [Wed, 15 Nov 2017 14:51:48 +0000 (14:51 +0000)] 
Init the signal handler ASAP so random stuff can be cleaned up.

7 years agoDHCPv6: confirm lease on carrier up
Roy Marples [Tue, 14 Nov 2017 16:41:59 +0000 (16:41 +0000)] 
DHCPv6: confirm lease on carrier up

On some platforms which preserve state when carrier goes down,
such as NetBSD-8, the state does not enter the CONFIRM state.
Add more logic to dhcp6_start so that we can better control this
from the various call points.

7 years agoIPv6ND: Fix lifetime overflow on carrier up
Roy Marples [Tue, 14 Nov 2017 15:37:23 +0000 (15:37 +0000)] 
IPv6ND: Fix lifetime overflow on carrier up

Set the acquired time of the address to now as we're forcing short
vltime and pltime.

7 years agoBSD: Strip scope from link-local addresses for KAME stacks
Roy Marples [Tue, 14 Nov 2017 12:16:26 +0000 (12:16 +0000)] 
BSD: Strip scope from link-local addresses for KAME stacks

This fixes DHCPv6 and IPv6ND trying to send messages from
DETACHED or TENTATIVE addresses when carrier comes back.

7 years agoif-linux: fix a potential NULL de-reference
Roy Marples [Mon, 6 Nov 2017 21:51:34 +0000 (21:51 +0000)] 
if-linux: fix a potential NULL de-reference

7 years agodhcp6: don't make delegated addresses stale
Roy Marples [Mon, 6 Nov 2017 12:37:02 +0000 (12:37 +0000)] 
dhcp6: don't make delegated addresses stale

7 years agodhcp6: redirect message to interface with matching xid
Roy Marples [Mon, 6 Nov 2017 12:15:53 +0000 (12:15 +0000)] 
dhcp6: redirect message to interface with matching xid

When unicasting and receiving unicasted messages, it's possible
that the outgoing and incoming interfaces don't match where the
address and/or prefix are.
To solve this, don't dictate the outgoing interface when unicasting
and match the incoming xid to one we have sent on another interface.

7 years agoEnsure that xid is unique across all interfaces.
Roy Marples [Mon, 6 Nov 2017 12:10:02 +0000 (12:10 +0000)] 
Ensure that xid is unique across all interfaces.

7 years agodhcpcd-run-hooks(8) should not attempt to guess the protocol.
Roy Marples [Fri, 3 Nov 2017 16:38:18 +0000 (16:38 +0000)] 
dhcpcd-run-hooks(8) should not attempt to guess the protocol.

7 years agoDHCPv6: listen on all IPv6 addresses for active interface
Roy Marples [Wed, 25 Oct 2017 13:56:23 +0000 (14:56 +0100)] 
DHCPv6: listen on all IPv6 addresses for active interface

Simplify the process of selecting addresses to listen for DHCPv6
replies on by listening on all addresses for active interfaces
when not in master mode.

Always send from a socket not bound to an address to ensure
unicast in non master mode works fine. The downside of this approach
is that we no longer send from the DHCPv6 client port, but this
seems to work fine, at least with ISC DHCPd.

7 years agoipv6nd: don't handle NA or RA if not active interface
Roy Marples [Wed, 25 Oct 2017 10:45:25 +0000 (11:45 +0100)] 
ipv6nd: don't handle NA or RA if not active interface

This stops interfaces activated only for delegating to from
receiving these messages by default.

7 years agobpf: remove the BPF_FREE flag
Roy Marples [Wed, 25 Oct 2017 08:15:10 +0000 (09:15 +0100)] 
bpf: remove the BPF_FREE flag

ARP code can just try and free the istate if no astates left
after finishing the read loop.

7 years agoarp: fix memory leak
Roy Marples [Tue, 24 Oct 2017 23:23:29 +0000 (00:23 +0100)] 
arp: fix memory leak

Prior patch introduced a memory leak if a new ARP state was
added after BPF_FREE was set. Cater for this.

7 years agoFix prior patches by using correct bitmasks for flags.
Roy Marples [Tue, 24 Oct 2017 23:04:44 +0000 (00:04 +0100)] 
Fix prior patches by using correct bitmasks for flags.
Add BPF_READING and BPF_FREE so that arp can free the state
after finishing the read loop.

7 years agoFix a boo boo
Roy Marples [Tue, 24 Oct 2017 22:33:27 +0000 (23:33 +0100)] 
Fix a boo boo

7 years agobpf: store flags in state for a better abort
Roy Marples [Tue, 24 Oct 2017 22:11:15 +0000 (23:11 +0100)] 
bpf: store flags in state for a better abort

There are cases when dhcp may close and open an ARP socket
during an ARP read. This means the fd will not be -1, so we need
to set BPF_EOF when closing the socket.

7 years agodhcp: arp announce existing address before reboot
Roy Marples [Mon, 23 Oct 2017 23:13:09 +0000 (00:13 +0100)] 
dhcp: arp announce existing address before reboot

This updates upstream ARP tables to send their ACK to the
interface we want to receive the message on and not one
which is not in use but has the same IP address.

Doing this means we no longer need to open DHCP sockets for
interfaces we're not interested in.

7 years agodhcp: improve error logging about UDP checksum failure
Roy Marples [Mon, 23 Oct 2017 09:55:28 +0000 (10:55 +0100)] 
dhcp: improve error logging about UDP checksum failure

7 years agoMake this more readable.
Roy Marples [Sat, 21 Oct 2017 13:10:02 +0000 (14:10 +0100)] 
Make this more readable.

7 years agoOpenBSD: Remove route labelling support
Roy Marples [Tue, 10 Oct 2017 20:51:55 +0000 (21:51 +0100)] 
OpenBSD: Remove route labelling support

It was only added because OpenBSD dhclient did similar .... that
was removed so dhcpcd is following suit.

7 years agoDon't attempt to flush IPv6 routers or prefixes if the kernel
Roy Marples [Tue, 10 Oct 2017 20:04:27 +0000 (21:04 +0100)] 
Don't attempt to flush IPv6 routers or prefixes if the kernel
does not support setting them.

7 years agoDon't mark statically configured IPv4 routes as DHCP.
Roy Marples [Mon, 9 Oct 2017 19:21:05 +0000 (20:21 +0100)] 
Don't mark statically configured IPv4 routes as DHCP.

7 years agoSet DHCP routes as DHCP in supported OS's.
Roy Marples [Mon, 9 Oct 2017 19:11:36 +0000 (20:11 +0100)] 
Set DHCP routes as DHCP in supported OS's.

7 years agoSet RA routes as RA in supported OS's.
Roy Marples [Mon, 9 Oct 2017 18:57:09 +0000 (19:57 +0100)] 
Set RA routes as RA in supported OS's.

7 years agoUpdate README from dhcpcd.conf
Roy Marples [Mon, 9 Oct 2017 09:28:03 +0000 (10:28 +0100)] 
Update README from dhcpcd.conf

7 years agoRelease dhcpcd-7.0.0-rc3 v7.0.0-rc3
Roy Marples [Sat, 7 Oct 2017 13:47:11 +0000 (14:47 +0100)] 
Release dhcpcd-7.0.0-rc3

7 years agoState it's a SLAAC address
Roy Marples [Sat, 7 Oct 2017 12:48:41 +0000 (13:48 +0100)] 
State it's a SLAAC address