Roy Marples [Mon, 15 Sep 2014 23:05:20 +0000 (23:05 +0000)]
It's possible to configure a Linux kernel with nl80211 where the
SSID won't be reported, but is available via WEXT.
This is very silly, but dhcpcd still needs to work.
Thus enable both protocols and use nl80211 if WEXT fails.
Roy Marples [Mon, 15 Sep 2014 22:35:00 +0000 (22:35 +0000)]
The args sent from control socket do not include a program in argv[0]
so we need to adjustem them to pretend that they do.
Tests show that getopt(3) doesn't look at argv[0] so it's safe(ish).
Roy Marples [Thu, 11 Sep 2014 14:30:52 +0000 (14:30 +0000)]
Revert [2a977647fe24819f38b64c8ed7257c0bc27c8328] because if the
services are touched in anyway by an exit hook their status might not
be entirely accurate.
Fixes some issues with parallel service management systems.
Roy Marples [Wed, 10 Sep 2014 01:46:58 +0000 (01:46 +0000)]
Use the nl80211 interface on Linux to get the wireless SSID.
If this is not found in the system headers, fall back to assuming WEXT.
This has been done because the WEXT module has been marked as deprecated
for a while now and I'm getting bored of people asking me why their
wireless wasn't working. Bloated dhcpcd by another 600 bytes as a result.
Roy Marples [Sun, 7 Sep 2014 17:24:07 +0000 (17:24 +0000)]
Split arc4random_uniform into it's own compat function and add
it's proper copyright.
Add a new test for it to configure so that we can use the
uclibc arc4random function and our compat arc4random_uniform function.
Roy Marples [Fri, 5 Sep 2014 12:28:05 +0000 (12:28 +0000)]
Implement a send queue for each control fd.
Only one call to write(2) should be performed for each POLLOUT check
via poll(2) so we should never see EAGAIN when writing to control
sockets ever again.
Each fd queue is limited to 100 entries so we don't OOM with badly
written control subscribers.
Roy Marples [Thu, 4 Sep 2014 19:30:47 +0000 (19:30 +0000)]
Add a write callback to eloop so we know when we can write to the socket.
This seems to be important for our control socket as sometimes, we fail to
write with EAGAIN and dhcpcd should not block on users of this socket.
Roy Marples [Mon, 1 Sep 2014 16:35:43 +0000 (16:35 +0000)]
As we listen and consume bootpc on the global socket, open and close
the ip specific socket when sending unicast messages instead of
just keeping it open.
Roy Marples [Wed, 30 Jul 2014 08:58:42 +0000 (08:58 +0000)]
Only bits 1 and 2 are used in the DHCP overload option, so when we encounter
the option set the last bit as well to ensure servername and bootfile are
only checked once as their check unsets bits 1 and 2.
Roy Marples [Tue, 22 Jul 2014 18:03:34 +0000 (18:03 +0000)]
When starting an interface and the carrier is UNKNOWN, wait 100ms before trying to start again.
UNKNOWN should only be reported for BSD systems where the carrier medium reports an error or is
not valid. In this case the carrier is only UP when IFF_RUNNING is set.
Roy Marples [Wed, 9 Jul 2014 10:51:20 +0000 (10:51 +0000)]
Ensure we have enough data for prefix exclude length in the option.
We don't request the excluded prefix itself, just what it is.
Ensure the excluded prefix is not applied to downstream interfaces.
Hopefully fixes [ac7063e671].
Roy Marples [Mon, 7 Jul 2014 14:41:18 +0000 (14:41 +0000)]
When requesting a IA_PD and another IA type, create a psuedo interface
to handle the IA_PD.
ia_pd_mix config option disables this and mixes IA_PD in the single session as
per draft-ietf-dhc-dhcpv6-stateful-issues-06.