]> git.ipfire.org Git - thirdparty/dhcpcd.git/log
thirdparty/dhcpcd.git
9 years agoUse DLPI to send and receive ARP and BOOTP packets.
Roy Marples [Tue, 17 May 2016 20:26:09 +0000 (20:26 +0000)] 
Use DLPI to send and receive ARP and BOOTP packets.
Use pfmod to filter the packets we want in the kernel.

9 years agoOnly accept BOOTREPLY.
Roy Marples [Mon, 16 May 2016 15:43:23 +0000 (15:43 +0000)] 
Only accept BOOTREPLY.

9 years agoMore DHCP -> BOOTP.
Roy Marples [Mon, 16 May 2016 15:19:28 +0000 (15:19 +0000)] 
More DHCP -> BOOTP.

9 years agodhcp_bpf_filter -> bootp_bpf_filter (and DHCP -> BOOTP for ports).
Roy Marples [Sat, 14 May 2016 16:35:23 +0000 (16:35 +0000)] 
dhcp_bpf_filter -> bootp_bpf_filter (and DHCP -> BOOTP for ports).

9 years agoNo point in looping on the raw socket anymore thanks to eloop.
Roy Marples [Sat, 14 May 2016 12:57:32 +0000 (12:57 +0000)] 
No point in looping on the raw socket anymore thanks to eloop.
This allows endless DHCP / ARP to be interuptable.

9 years agoUse UNCONST
Roy Marples [Sat, 14 May 2016 10:38:15 +0000 (10:38 +0000)] 
Use UNCONST

9 years agoGive some context to if_closeraw
Roy Marples [Fri, 13 May 2016 15:53:57 +0000 (15:53 +0000)] 
Give some context to if_closeraw

9 years agoRework the raw packet API so we work directly with a fd.
Roy Marples [Fri, 13 May 2016 15:41:58 +0000 (15:41 +0000)] 
Rework the raw packet API so we work directly with a fd.
It's possible the underlying mechanism might not use the fd as a primary
resource, so add the if_closeraw() function.

9 years agowhitespace
Roy Marples [Fri, 13 May 2016 13:59:24 +0000 (13:59 +0000)] 
whitespace

9 years agoImprove memory allocation parsing routes and provide a better
Roy Marples [Fri, 13 May 2016 10:35:35 +0000 (10:35 +0000)] 
Improve memory allocation parsing routes and provide a better
diagnostic if the interface for it cannot be found.

9 years agolo0 doesn't appear in dlpi_walk, so create an empty AF_LINK for it.
Roy Marples [Fri, 13 May 2016 10:33:15 +0000 (10:33 +0000)] 
lo0 doesn't appear in dlpi_walk, so create an empty AF_LINK for it.

9 years agoIf we don't have a broadcast address, set zero on assignment.
Roy Marples [Fri, 13 May 2016 10:31:00 +0000 (10:31 +0000)] 
If we don't have a broadcast address, set zero on assignment.

9 years agoLearn about routing tables on Solaris.
Roy Marples [Thu, 12 May 2016 16:51:36 +0000 (16:51 +0000)] 
Learn about routing tables on Solaris.

9 years agoinitrt should really take dhcpcd_ctx as an argument.
Roy Marples [Thu, 12 May 2016 10:45:21 +0000 (10:45 +0000)] 
initrt should really take dhcpcd_ctx as an argument.

9 years agoHandle truncated DHCP messages, provided only the BOOTP vendor area is
Roy Marples [Wed, 11 May 2016 14:17:15 +0000 (14:17 +0000)] 
Handle truncated DHCP messages, provided only the  BOOTP vendor area is
truncated. Fixes [3f10c9b871].

9 years agoAvoid a "conversion to '__uint16_t' from 'int' may alter its value"
Roy Marples [Tue, 10 May 2016 07:37:30 +0000 (07:37 +0000)] 
Avoid a "conversion to '__uint16_t' from 'int' may alter its value"
error on some architectures (like m68k).

Thanks to Martin Husemann.

9 years agoNote dhcpcd -v in options, fixes [46237d7e79].
Roy Marples [Mon, 9 May 2016 10:41:59 +0000 (10:41 +0000)] 
Note dhcpcd -v in options, fixes [46237d7e79].

9 years agoRelease dhcpcd-6.11.0 v6.11.0
Roy Marples [Mon, 9 May 2016 09:35:34 +0000 (09:35 +0000)] 
Release dhcpcd-6.11.0

9 years agoPreserve lo0 routes if the global default is to persist.
Roy Marples [Mon, 9 May 2016 08:22:38 +0000 (08:22 +0000)] 
Preserve lo0 routes if the global default is to persist.

9 years agoFix deleting the reject route on Linux, [efc359da01].
Roy Marples [Sun, 8 May 2016 15:44:12 +0000 (15:44 +0000)] 
Fix deleting the reject route on Linux, [efc359da01].

9 years agoNo need for ;
Roy Marples [Sun, 8 May 2016 10:18:49 +0000 (10:18 +0000)] 
No need for ;

9 years agoWhitespace.
Roy Marples [Sat, 7 May 2016 21:27:34 +0000 (21:27 +0000)] 
Whitespace.

9 years agoFix option concatenation.
Roy Marples [Sat, 7 May 2016 21:25:02 +0000 (21:25 +0000)] 
Fix option concatenation.

9 years agoWhen removing delegated addresses, ensure the reject route is restored.
Roy Marples [Sat, 7 May 2016 20:40:40 +0000 (20:40 +0000)] 
When removing delegated addresses, ensure the reject route is restored.

9 years agoWhite space.
Roy Marples [Sat, 7 May 2016 19:58:11 +0000 (19:58 +0000)] 
White space.

9 years agoDon't realloc delegated prefixes needlessly.
Roy Marples [Sat, 7 May 2016 19:55:48 +0000 (19:55 +0000)] 
Don't realloc delegated prefixes needlessly.

9 years agoRevert prior
Roy Marples [Sat, 7 May 2016 19:53:54 +0000 (19:53 +0000)] 
Revert prior

9 years agoRemember the delegating prefix rather than the delegating interface.
Roy Marples [Sat, 7 May 2016 12:21:35 +0000 (12:21 +0000)] 
Remember the delegating prefix rather than the delegating interface.
This allows us to clear the NOREJECT flag if we ever delete the delegated
address.

9 years agoAlways set HAVE_REALLOCARRAY so that eloop can use it.
Roy Marples [Sat, 7 May 2016 12:20:36 +0000 (12:20 +0000)] 
Always set HAVE_REALLOCARRAY so that eloop can use it.

9 years agoUse libc reallocarray in eloop if we have it.
Roy Marples [Fri, 6 May 2016 20:51:37 +0000 (20:51 +0000)] 
Use libc reallocarray in eloop if we have it.

9 years agoCheck we actually have options allocated before adding commandline options.
Roy Marples [Fri, 6 May 2016 20:44:24 +0000 (20:44 +0000)] 
Check we actually have options allocated before adding commandline options.

9 years agoFix a bogus clang analyzer warning on BSD by moving an assignment slightly higher up.
Roy Marples [Fri, 6 May 2016 20:09:09 +0000 (20:09 +0000)] 
Fix a bogus clang analyzer warning on BSD by moving an assignment slightly higher up.

9 years agoDon't install a reject route if the prefix is the same as the delegation, [efc359da01].
Roy Marples [Fri, 6 May 2016 18:45:01 +0000 (18:45 +0000)] 
Don't install a reject route if the prefix is the same as the delegation, [efc359da01].

9 years agoNo need to check if the passed pointer is valid.
Roy Marples [Fri, 6 May 2016 18:15:41 +0000 (18:15 +0000)] 
No need to check if the passed pointer is valid.

9 years agoFix some memory issues.
Roy Marples [Fri, 6 May 2016 16:28:54 +0000 (16:28 +0000)] 
Fix some memory issues.

9 years agoFree the getline buffer if needed.
Roy Marples [Fri, 6 May 2016 16:23:26 +0000 (16:23 +0000)] 
Free the getline buffer if needed.

9 years agoMove duid and ipv6 secret file reading code into a common function.
Roy Marples [Fri, 6 May 2016 16:01:54 +0000 (16:01 +0000)] 
Move duid and ipv6 secret file reading code into a common function.

9 years agoMove packet buffer from dhcpcd context to a generic stack variable based on MTU_MAX.
Roy Marples [Fri, 6 May 2016 14:46:32 +0000 (14:46 +0000)] 
Move packet buffer from dhcpcd context to a generic stack variable based on MTU_MAX.

9 years agoDHCP messages are really BOOTP so lets name the structure accordingly.
Roy Marples [Fri, 6 May 2016 13:26:41 +0000 (13:26 +0000)] 
DHCP messages are really BOOTP so lets name the structure accordingly.
While here, stop making assumptions about the size of a DHCP packet based
on a fixed structure from a default MTU of 1500.
Instead, make it flexable and set the DHCP packet size to the interface MTU
less UDP and IP headers.
As a result, we need to know the size of the DHCP packet received
rather than just walking the old fixed DHCP message structure.

This makes Coverity happy about tainted scalar values when parsing DHCP
messages.

9 years agoMove dhcp6's read lease code into dhcp-common.
Roy Marples [Fri, 6 May 2016 13:02:41 +0000 (13:02 +0000)] 
Move dhcp6's read lease code into dhcp-common.
While here, fix MTU min/max.

9 years agoCheck a calloc failure.
Roy Marples [Fri, 6 May 2016 12:51:01 +0000 (12:51 +0000)] 
Check a calloc failure.

9 years agoFix comment.
Roy Marples [Wed, 4 May 2016 13:07:10 +0000 (13:07 +0000)] 
Fix comment.

9 years agoRemove random() from a potential htonl() macro which could call it more than once.
Roy Marples [Wed, 4 May 2016 13:05:52 +0000 (13:05 +0000)] 
Remove random() from a potential htonl() macro which could call it more than once.

9 years agoRead from BPF into a void pointer aliased to the buffer so that
Roy Marples [Wed, 4 May 2016 12:34:13 +0000 (12:34 +0000)] 
Read from BPF into a void pointer aliased to the buffer so that
Coverity doesn't treat the data as tainted.
Of course it's tainted, but Coverity doesn't undertand our rules
ensuring the data is clean.

9 years agoFix returning a pid if open fails.
Roy Marples [Wed, 4 May 2016 12:32:29 +0000 (12:32 +0000)] 
Fix returning a pid if open fails.

9 years agoFix compile.
Roy Marples [Wed, 4 May 2016 11:51:44 +0000 (11:51 +0000)] 
Fix compile.

9 years agoCheck for NULL.
Roy Marples [Wed, 4 May 2016 11:48:51 +0000 (11:48 +0000)] 
Check for NULL.

9 years agoFix reallocarray test
Roy Marples [Wed, 4 May 2016 11:39:37 +0000 (11:39 +0000)] 
Fix reallocarray test

9 years agoOptimize code to find a route interface.
Roy Marples [Wed, 4 May 2016 11:02:44 +0000 (11:02 +0000)] 
Optimize code to find a route interface.
While here, fix a memory issue.

9 years agoUse void * to read the DHCP lease file as that seems to pass the Coverity
Roy Marples [Tue, 3 May 2016 23:54:20 +0000 (23:54 +0000)] 
Use void * to read the DHCP lease file as that seems to pass the Coverity
tests.

9 years agoUse a union to read an old lease.
Roy Marples [Tue, 3 May 2016 23:19:57 +0000 (23:19 +0000)] 
Use a union to read an old lease.

9 years agoApply a bit more security around parsing DHCP.
Roy Marples [Tue, 3 May 2016 22:50:53 +0000 (22:50 +0000)] 
Apply a bit more security around parsing DHCP.

9 years agoAdd a guard to ensure any needed argument is provided.
Roy Marples [Tue, 3 May 2016 22:09:16 +0000 (22:09 +0000)] 
Add a guard to ensure any needed argument is provided.

9 years agoFix a potential memory issue.
Roy Marples [Tue, 3 May 2016 20:25:30 +0000 (20:25 +0000)] 
Fix a potential memory issue.

9 years agoFix reading long DHCPv6 leases.
Roy Marples [Tue, 3 May 2016 16:21:20 +0000 (16:21 +0000)] 
Fix reading long DHCPv6 leases.

9 years agoFix closing fd.
Roy Marples [Tue, 3 May 2016 15:43:34 +0000 (15:43 +0000)] 
Fix closing fd.

9 years agoTell Coverity that we do need to call initstate() for IPv4LL addresses.
Roy Marples [Tue, 3 May 2016 15:26:18 +0000 (15:26 +0000)] 
Tell Coverity that we do need to  call initstate() for IPv4LL addresses.

9 years agoTell Coverity that we do need to call random() for IPv4LL addresses.
Roy Marples [Tue, 3 May 2016 15:18:39 +0000 (15:18 +0000)] 
Tell Coverity that we do need to  call random() for IPv4LL addresses.

9 years agoUse a local variable to indicate if we need to close the fd we may have
Roy Marples [Tue, 3 May 2016 15:06:22 +0000 (15:06 +0000)] 
Use a local variable to indicate if we need to close the fd we may have
opened when reading leases.

9 years agoRework control_open to be cleaner for static analysis.
Roy Marples [Tue, 3 May 2016 14:31:50 +0000 (14:31 +0000)] 
Rework control_open to be cleaner for static analysis.

9 years agoRemove useless range check.
Roy Marples [Tue, 3 May 2016 14:17:37 +0000 (14:17 +0000)] 
Remove useless range check.

9 years agoDocument some coverity false positives.
Roy Marples [Tue, 3 May 2016 13:55:07 +0000 (13:55 +0000)] 
Document some coverity false positives.

9 years agoFix a constant expression result.
Roy Marples [Tue, 3 May 2016 12:34:34 +0000 (12:34 +0000)] 
Fix a constant expression result.

9 years agoReally fix the TOCTOU error.
Roy Marples [Tue, 3 May 2016 12:19:35 +0000 (12:19 +0000)] 
Really fix the TOCTOU error.

9 years agoFix math.
Roy Marples [Tue, 3 May 2016 12:12:15 +0000 (12:12 +0000)] 
Fix math.

9 years agoUse reallocarray(3) to fix a pontential overflow issue discovered by Coverity.
Roy Marples [Tue, 3 May 2016 11:54:25 +0000 (11:54 +0000)] 
Use reallocarray(3) to fix a pontential overflow issue discovered by Coverity.
Provide a shim based on our eloop one if not available in libc.

9 years agoFix a memory leak reported by Coverity.
Roy Marples [Tue, 3 May 2016 11:20:47 +0000 (11:20 +0000)] 
Fix a memory leak reported by Coverity.

9 years agocontrol_open() should always return the fd to help static analysis.
Roy Marples [Tue, 3 May 2016 11:07:57 +0000 (11:07 +0000)] 
control_open() should always return the fd to help static analysis.

9 years agoExplain to Coverity why overrunning sockaddr_ll for IPoIB interfaces can happen and...
Roy Marples [Tue, 3 May 2016 10:55:57 +0000 (10:55 +0000)] 
Explain to Coverity why overrunning sockaddr_ll for IPoIB interfaces can happen and is catered for.

9 years agoFix a Coverity error by avoiding a memset with zero length.
Roy Marples [Tue, 3 May 2016 10:25:42 +0000 (10:25 +0000)] 
Fix a Coverity error by avoiding a memset with zero length.

9 years agoFix some issues reported by Converity.
Roy Marples [Tue, 3 May 2016 10:14:14 +0000 (10:14 +0000)] 
Fix some issues reported by Converity.

9 years agoTell coverity that we don't care about this errors because they
Roy Marples [Tue, 3 May 2016 09:15:28 +0000 (09:15 +0000)] 
Tell coverity that we don't care about this errors because they
are intentional.

9 years agoSolaris does not return AF_LINK addresses in getifaddrs(3), so
Roy Marples [Mon, 2 May 2016 01:55:50 +0000 (01:55 +0000)] 
Solaris does not return AF_LINK addresses in getifaddrs(3), so
link to dlpi, walk the interfaces and obtain the physical address
of each interface.

9 years agoFix compile on sunos again.
Roy Marples [Sun, 1 May 2016 14:51:10 +0000 (14:51 +0000)] 
Fix compile on sunos again.

9 years agoFix a signed/unsigned comparison.
Roy Marples [Sun, 1 May 2016 14:46:31 +0000 (14:46 +0000)] 
Fix a signed/unsigned comparison.

9 years agoTest exit status of which, not just stdout.
Roy Marples [Sun, 1 May 2016 14:39:45 +0000 (14:39 +0000)] 
Test exit status of which, not just stdout.

9 years agoNot all systems supply sys/cdefs.h and some require limits.h for PATH_MAX.
Roy Marples [Sun, 1 May 2016 14:30:08 +0000 (14:30 +0000)] 
Not all systems supply sys/cdefs.h and some require limits.h for PATH_MAX.

9 years agoPrefix dhcp definition type with OT_
Roy Marples [Sun, 1 May 2016 14:20:21 +0000 (14:20 +0000)] 
Prefix dhcp definition type with OT_

9 years agoMove last last extending into it's own option so we can use the last lease
Roy Marples [Sat, 30 Apr 2016 07:30:40 +0000 (07:30 +0000)] 
Move last last extending into it's own option so we can use the last lease
in a RFC compliant or incompliant way by choice.

9 years agoExtending dhcp lease on expire should respect ARP being disabled.
Roy Marples [Fri, 29 Apr 2016 23:09:40 +0000 (23:09 +0000)] 
Extending dhcp lease on expire should respect ARP being disabled.

9 years agoWhen the leaselease option is given, retain the lease when the DHCP lease
Roy Marples [Fri, 29 Apr 2016 22:48:19 +0000 (22:48 +0000)] 
When the leaselease option is given, retain the lease when the DHCP lease
expires, which mirrors how dhcpcd works when it starts up.
However, if any ARP probe is for the address, drop the lease right away
and continue discovery.

9 years agoAllow arp_open to be called publically.
Roy Marples [Fri, 29 Apr 2016 22:42:48 +0000 (22:42 +0000)] 
Allow arp_open to be called publically.

9 years agoKeep the ARP state open on announce so we can detect duplicates.
Roy Marples [Fri, 29 Apr 2016 22:41:51 +0000 (22:41 +0000)] 
Keep the ARP state open on announce so we can detect duplicates.

9 years agoFix a potential access after free issue.
Roy Marples [Fri, 29 Apr 2016 22:37:26 +0000 (22:37 +0000)] 
Fix a potential access after free issue.

9 years agoDescribe multiple interfaces, master mode and single interfaces better.
Roy Marples [Wed, 27 Apr 2016 22:19:16 +0000 (22:19 +0000)] 
Describe multiple interfaces, master mode and single interfaces better.

9 years agoSave BOOTP leases so they can be dumped.
Roy Marples [Wed, 27 Apr 2016 09:21:08 +0000 (09:21 +0000)] 
Save BOOTP leases so they can be dumped.
Fixes [9b7689a3a4].

9 years agoRevert prior and just move the RUNDIR check above pidfile_lock.
Roy Marples [Tue, 26 Apr 2016 20:09:34 +0000 (20:09 +0000)] 
Revert prior and just move the RUNDIR check above pidfile_lock.

9 years agoAdd a hack to ensure RUNDIR exists.
Roy Marples [Tue, 26 Apr 2016 20:07:29 +0000 (20:07 +0000)] 
Add a hack to ensure RUNDIR exists.

9 years agoEnsure we use the correct rundir.
Roy Marples [Tue, 26 Apr 2016 19:28:58 +0000 (19:28 +0000)] 
Ensure we use the correct rundir.

9 years agoLinux does not change netmask/broadcast addresses when re-adding an address.
Roy Marples [Mon, 25 Apr 2016 19:00:55 +0000 (19:00 +0000)] 
Linux does not change netmask/broadcast addresses when re-adding an address.

9 years agoUpdate remembered addresses for netmask and broadcast addresss.
Roy Marples [Mon, 25 Apr 2016 16:23:37 +0000 (16:23 +0000)] 
Update remembered addresses for netmask and broadcast addresss.

9 years agoIf a DHCP state is ARP probbed successfully and we're bound then don't do anything.
Roy Marples [Mon, 25 Apr 2016 16:23:10 +0000 (16:23 +0000)] 
If a DHCP state is ARP probbed successfully and we're bound then don't do anything.

9 years agoReport the broadcast address being added.
Roy Marples [Mon, 25 Apr 2016 13:15:56 +0000 (13:15 +0000)] 
Report the broadcast address being added.

9 years agoWe can only check rtm_pid for the correct pid - other messages
Roy Marples [Mon, 25 Apr 2016 13:03:52 +0000 (13:03 +0000)] 
We can only check rtm_pid for the correct pid - other messages
do not have this sadly.

9 years agoIgnore address removals if the broadcast address is the same as well as the
Roy Marples [Mon, 25 Apr 2016 13:03:24 +0000 (13:03 +0000)] 
Ignore address removals if the broadcast address is the same as well as the
netmask address.

9 years agoFix compile.
Roy Marples [Mon, 25 Apr 2016 11:53:33 +0000 (11:53 +0000)] 
Fix compile.

9 years agodst becomes brd as it's makes more sense as we mainly deal with ethernet.
Roy Marples [Mon, 25 Apr 2016 10:58:18 +0000 (10:58 +0000)] 
dst becomes brd as it's makes more sense as we mainly deal with ethernet.
Ensure that handleifa is always passed brd.
If brd does not match existing broadcast address on an existing inet address,
delete it and add our new one.

9 years agoWhitespace police.
Roy Marples [Mon, 25 Apr 2016 10:49:51 +0000 (10:49 +0000)] 
Whitespace police.

9 years agoCID 1358677: (Negative returns) tuck in poll_fd assignment in eloop_open(), thanks...
Roy Marples [Sun, 24 Apr 2016 19:55:22 +0000 (19:55 +0000)] 
CID 1358677: (Negative returns) tuck in poll_fd assignment in eloop_open(), thanks to Christos.

9 years agoCID 1358676: Forward NULL.
Roy Marples [Sun, 24 Apr 2016 19:46:28 +0000 (19:46 +0000)] 
CID 1358676: Forward NULL.