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.
Roy Marples [Fri, 4 Jul 2014 11:53:56 +0000 (11:53 +0000)]
Add --pfxdlgonly and --nopfxdlg options to spawn separate dhcpcd instances
to allow for RFC conformance when you need to configure a Prefix Delegation
and a Normal Address for DHCPv6 on the same interface.
Roy Marples [Wed, 2 Jul 2014 13:15:18 +0000 (13:15 +0000)]
Stop restoring kernel flags to their state before dhcpcd ran.
As multiple dhcpcd daemons could be in use to facilitate separate sessions
per DHCPv6 IA resetting them at exist could break the others.
Roy Marples [Tue, 1 Jul 2014 20:34:19 +0000 (20:34 +0000)]
Support http://datatracker.ietf.org/doc/draft-ietf-dhc-dhcpv6-stateful-issues.
It's not an RFC yet, but it seems it's needed for Prefix Delegation to work
on ComCast where a IA_NA is required as well.