Roy Marples [Mon, 18 Feb 2013 21:25:07 +0000 (21:25 +0000)]
Change from ppoll(2) to pollts(2).
I was going to go with ppoll(2) because I would guess the Open Group
would prefer the name of it over pollts(2) if they ever standardised it.
However that causes a problem with _GNU_SOURCE and my code base so I've
gone to pollts(2) and suck in the compat header for Linux users to avoid
that sillyness.
Roy Marples [Mon, 18 Feb 2013 20:56:55 +0000 (20:56 +0000)]
Rework our signal setup and event loop around ppoll(2).
ppoll is mapped to pollts(2) for supporting systems.
If pselect(2) is available then we provide a compat shim for that, otherwise
we provide a non race free shim based on poll(2).
Roy Marples [Mon, 18 Feb 2013 10:35:47 +0000 (10:35 +0000)]
Move the signal reboot code into it's own function which is fired by
and eloop timeout of 0 seconds. We do this because we shouldn't modify
variables in a signal handler.
Roy Marples [Sat, 16 Feb 2013 13:21:35 +0000 (13:21 +0000)]
Remove the xmalloc function.
Now we have removed all our xmalloc like functions dhcpcd can still
try to operate as best it can in low memory conditions.
Roy Marples [Fri, 15 Feb 2013 20:33:13 +0000 (20:33 +0000)]
Instead of opening link, ipv6, ipv6rs and ipv6ns sockets globally,
only open when the first link wanting this features needs it.
Hopefully fixes #263 and #264.
Roy Marples [Tue, 5 Feb 2013 10:15:59 +0000 (10:15 +0000)]
If we have one interface enabled for IPv6 RS, we stupidly process
RAs for all interfaces we control. This patch fixes this and
updates the man page to reflect this better.
Roy Marples [Sat, 2 Feb 2013 14:05:55 +0000 (14:05 +0000)]
Remove IPv4 and DHCP4 specific setup from dhcpcd.c and move into ipv4.c
and dhcp.c
Split configure.c into script.c and move the rest into dhcp.c
This starts the goal of making the base of dhcpcd protocol agnostic and
working towards building IPv4 and/or IPv6 code only to reduce size and
allow growing any future new protocol easier.
Roy Marples [Sun, 11 Nov 2012 00:04:02 +0000 (00:04 +0000)]
Because posix_spawn(2) implementations can use fork(2) we have no
way of knowing any error actually executing the new image,
such as it doesn't exist or no permission.
Roy Marples [Sat, 10 Nov 2012 16:38:52 +0000 (16:38 +0000)]
Replace poll(2) with pselect(2) and vfork(2)+execve(2) with
posix_spawn(3).
Now we block all our signals at startup and allow pselect to
unblock them for the duration of the call. This allows us to
manage interrupts in a fashion to guarantee a consistent
internal state.
I have added a posix_spawn compat shim for systems that lack
that call. pselect(2) has been supported on target for some time
so there is no need for a compat shim there.
Roy Marples [Wed, 31 Oct 2012 17:10:22 +0000 (17:10 +0000)]
When we receive a RA with a lifetime of 0, we should just remove
the default router and let any options expire as set in accordance
with RFC4861 section 4.2
Roy Marples [Wed, 24 Oct 2012 11:47:28 +0000 (11:47 +0000)]
If we receive a packet with two options the same which is not
supposed to be an array then we now trim to the correct size
rather than just discarding the option.
This also means that if any garbage at the end of the singule
occurance of an option is also discarded.
Roy Marples [Fri, 12 Oct 2012 10:31:51 +0000 (10:31 +0000)]
Add DHCPv6 INFORM support.
This is automatically started when RA flags O is set.
If no DHCPv6 request options are configured in dhcpcd.conf then we
request domain servers and search lists.