]>
git.ipfire.org Git - thirdparty/dhcpcd.git/log
Roy Marples [Sat, 7 May 2016 19:55:48 +0000 (19:55 +0000)]
Don't realloc delegated prefixes needlessly.
Roy Marples [Sat, 7 May 2016 19:53:54 +0000 (19:53 +0000)]
Revert prior
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.
Roy Marples [Sat, 7 May 2016 12:20:36 +0000 (12:20 +0000)]
Always set HAVE_REALLOCARRAY so that eloop can use it.
Roy Marples [Fri, 6 May 2016 20:51:37 +0000 (20:51 +0000)]
Use libc reallocarray in eloop if we have it.
Roy Marples [Fri, 6 May 2016 20:44:24 +0000 (20:44 +0000)]
Check we actually have options allocated before adding commandline options.
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.
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 ].
Roy Marples [Fri, 6 May 2016 18:15:41 +0000 (18:15 +0000)]
No need to check if the passed pointer is valid.
Roy Marples [Fri, 6 May 2016 16:28:54 +0000 (16:28 +0000)]
Fix some memory issues.
Roy Marples [Fri, 6 May 2016 16:23:26 +0000 (16:23 +0000)]
Free the getline buffer if needed.
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.
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.
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.
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.
Roy Marples [Fri, 6 May 2016 12:51:01 +0000 (12:51 +0000)]
Check a calloc failure.
Roy Marples [Wed, 4 May 2016 13:07:10 +0000 (13:07 +0000)]
Fix comment.
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.
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.
Roy Marples [Wed, 4 May 2016 12:32:29 +0000 (12:32 +0000)]
Fix returning a pid if open fails.
Roy Marples [Wed, 4 May 2016 11:51:44 +0000 (11:51 +0000)]
Fix compile.
Roy Marples [Wed, 4 May 2016 11:48:51 +0000 (11:48 +0000)]
Check for NULL.
Roy Marples [Wed, 4 May 2016 11:39:37 +0000 (11:39 +0000)]
Fix reallocarray test
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.
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.
Roy Marples [Tue, 3 May 2016 23:19:57 +0000 (23:19 +0000)]
Use a union to read an old lease.
Roy Marples [Tue, 3 May 2016 22:50:53 +0000 (22:50 +0000)]
Apply a bit more security around parsing DHCP.
Roy Marples [Tue, 3 May 2016 22:09:16 +0000 (22:09 +0000)]
Add a guard to ensure any needed argument is provided.
Roy Marples [Tue, 3 May 2016 20:25:30 +0000 (20:25 +0000)]
Fix a potential memory issue.
Roy Marples [Tue, 3 May 2016 16:21:20 +0000 (16:21 +0000)]
Fix reading long DHCPv6 leases.
Roy Marples [Tue, 3 May 2016 15:43:34 +0000 (15:43 +0000)]
Fix closing fd.
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.
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.
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.
Roy Marples [Tue, 3 May 2016 14:31:50 +0000 (14:31 +0000)]
Rework control_open to be cleaner for static analysis.
Roy Marples [Tue, 3 May 2016 14:17:37 +0000 (14:17 +0000)]
Remove useless range check.
Roy Marples [Tue, 3 May 2016 13:55:07 +0000 (13:55 +0000)]
Document some coverity false positives.
Roy Marples [Tue, 3 May 2016 12:34:34 +0000 (12:34 +0000)]
Fix a constant expression result.
Roy Marples [Tue, 3 May 2016 12:19:35 +0000 (12:19 +0000)]
Really fix the TOCTOU error.
Roy Marples [Tue, 3 May 2016 12:12:15 +0000 (12:12 +0000)]
Fix math.
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.
Roy Marples [Tue, 3 May 2016 11:20:47 +0000 (11:20 +0000)]
Fix a memory leak reported by Coverity.
Roy Marples [Tue, 3 May 2016 11:07:57 +0000 (11:07 +0000)]
control_open() should always return the fd to help static analysis.
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.
Roy Marples [Tue, 3 May 2016 10:25:42 +0000 (10:25 +0000)]
Fix a Coverity error by avoiding a memset with zero length.
Roy Marples [Tue, 3 May 2016 10:14:14 +0000 (10:14 +0000)]
Fix some issues reported by Converity.
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.
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.
Roy Marples [Sun, 1 May 2016 14:51:10 +0000 (14:51 +0000)]
Fix compile on sunos again.
Roy Marples [Sun, 1 May 2016 14:46:31 +0000 (14:46 +0000)]
Fix a signed/unsigned comparison.
Roy Marples [Sun, 1 May 2016 14:39:45 +0000 (14:39 +0000)]
Test exit status of which, not just stdout.
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.
Roy Marples [Sun, 1 May 2016 14:20:21 +0000 (14:20 +0000)]
Prefix dhcp definition type with OT_
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.
Roy Marples [Fri, 29 Apr 2016 23:09:40 +0000 (23:09 +0000)]
Extending dhcp lease on expire should respect ARP being disabled.
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.
Roy Marples [Fri, 29 Apr 2016 22:42:48 +0000 (22:42 +0000)]
Allow arp_open to be called publically.
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.
Roy Marples [Fri, 29 Apr 2016 22:37:26 +0000 (22:37 +0000)]
Fix a potential access after free issue.
Roy Marples [Wed, 27 Apr 2016 22:19:16 +0000 (22:19 +0000)]
Describe multiple interfaces, master mode and single interfaces better.
Roy Marples [Wed, 27 Apr 2016 09:21:08 +0000 (09:21 +0000)]
Save BOOTP leases so they can be dumped.
Fixes [
9b7689a3a4 ].
Roy Marples [Tue, 26 Apr 2016 20:09:34 +0000 (20:09 +0000)]
Revert prior and just move the RUNDIR check above pidfile_lock.
Roy Marples [Tue, 26 Apr 2016 20:07:29 +0000 (20:07 +0000)]
Add a hack to ensure RUNDIR exists.
Roy Marples [Tue, 26 Apr 2016 19:28:58 +0000 (19:28 +0000)]
Ensure we use the correct rundir.
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.
Roy Marples [Mon, 25 Apr 2016 16:23:37 +0000 (16:23 +0000)]
Update remembered addresses for netmask and broadcast addresss.
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.
Roy Marples [Mon, 25 Apr 2016 13:15:56 +0000 (13:15 +0000)]
Report the broadcast address being added.
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.
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.
Roy Marples [Mon, 25 Apr 2016 11:53:33 +0000 (11:53 +0000)]
Fix compile.
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.
Roy Marples [Mon, 25 Apr 2016 10:49:51 +0000 (10:49 +0000)]
Whitespace police.
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.
Roy Marples [Sun, 24 Apr 2016 19:46:28 +0000 (19:46 +0000)]
CID
1358676 : Forward NULL.
Roy Marples [Fri, 22 Apr 2016 21:07:22 +0000 (21:07 +0000)]
Remove closefrom as we don't suffer from fd starvation.
Roy Marples [Thu, 21 Apr 2016 19:30:19 +0000 (19:30 +0000)]
Clarify the reasoning for not installing a blackhole route for a PD.
Roy Marples [Thu, 21 Apr 2016 19:27:31 +0000 (19:27 +0000)]
RFC3315 Section 12.1 is a little vague about adding bits to the prefix.
The correct interpretation is that we must add bits to the prefix length,
thus having a sla_id of 0 is valid because the prefix_length is always
extended.
Roy Marples [Wed, 20 Apr 2016 08:37:23 +0000 (08:37 +0000)]
Release dhcpcd-6.10.3
Roy Marples [Wed, 20 Apr 2016 08:29:08 +0000 (08:29 +0000)]
RFC 3927 Section 2.5 says a defence of an address should ARP announce it.
This is unicast, whereas the default kernel action is to unicast a stock
reply, so the client that tried to claim the address will receive two replies.
Fixes [
a19bb0eae6 ].
Roy Marples [Mon, 18 Apr 2016 12:49:35 +0000 (12:49 +0000)]
Add sys/file.h so we can get to flock(2).
Roy Marples [Mon, 18 Apr 2016 08:34:56 +0000 (08:34 +0000)]
Sync latest from NetBSD.
Roy Marples [Mon, 18 Apr 2016 06:14:55 +0000 (06:14 +0000)]
Fix compile on BSD.
Roy Marples [Sun, 17 Apr 2016 14:00:09 +0000 (14:00 +0000)]
Improve xsocket to have the same API as socket.
Roy Marples [Sat, 16 Apr 2016 21:17:49 +0000 (21:17 +0000)]
Clarify sla 0.
Roy Marples [Sat, 16 Apr 2016 21:11:54 +0000 (21:11 +0000)]
Don't drop DHCPv6 if the interface is delegated to when there are no IPv6 routers for it.
Roy Marples [Sat, 16 Apr 2016 20:32:11 +0000 (20:32 +0000)]
If sla is 0, just copy the prefix and don't set a blackhole route if end prefix is the same as the delegated prefix. Fixes [
7461677bd0 ].
Roy Marples [Sat, 16 Apr 2016 20:30:53 +0000 (20:30 +0000)]
Warn that an sla of 0 is not RFC3633 (section 12.1) compliant.
Roy Marples [Wed, 13 Apr 2016 16:45:52 +0000 (16:45 +0000)]
Set -DHAVE_CONFIG_H after it's blanked on user config. Fixes [
ceb1077c23 ].
Roy Marples [Tue, 12 Apr 2016 20:14:42 +0000 (20:14 +0000)]
Move embedded test to after setting compiler options to fix a build issue with quotes.
Roy Marples [Tue, 12 Apr 2016 14:15:11 +0000 (14:15 +0000)]
iSNS is option 83, not 84.
Roy Marples [Mon, 11 Apr 2016 16:25:54 +0000 (16:25 +0000)]
Add support for int8 and uint8 data types.
Rename SINT* to INT* to match C semantics.
Roy Marples [Mon, 11 Apr 2016 15:40:16 +0000 (15:40 +0000)]
Fix prior definition.
Roy Marples [Mon, 11 Apr 2016 12:53:53 +0000 (12:53 +0000)]
Support iSNS, RFC4174.
While here, don't crash if we enter the wrong keyword in dhcpcd-definitions.
Roy Marples [Sun, 10 Apr 2016 20:15:36 +0000 (20:15 +0000)]
Sync pidfile.c from NetBSD.
Roy Marples [Sun, 10 Apr 2016 18:46:12 +0000 (18:46 +0000)]
Make fork process clearer.
Roy Marples [Fri, 8 Apr 2016 20:54:04 +0000 (20:54 +0000)]
Release dhcpcd-6.10.2
Roy Marples [Fri, 8 Apr 2016 20:50:58 +0000 (20:50 +0000)]
Fix compile warnings.
Roy Marples [Fri, 8 Apr 2016 20:35:09 +0000 (20:35 +0000)]
Don't dick with IPv4LL route reactions on BSD.
Roy Marples [Fri, 8 Apr 2016 20:02:41 +0000 (20:02 +0000)]
If a normal default route is added, delete our IPv4LL default route.
If a normal defaulr route is deleted, and no other exists, add our IPv4LL
default route.
Fixes [
bd6daf1d59 ].