Commit Graph

60 Commits

Author SHA1 Message Date
Roy Marples
4830bb6222 Fix compile without IPv6. 2015-12-03 20:43:41 +00:00
Roy Marples
56a660173f Add a -N --renew option to renew any existing address early, similar to the
-n --rebind option. However, configuration is not reloaded.

Fixes [6cf818eeab].
2015-11-13 10:37:27 +00:00
Roy Marples
3823dbf556 Backout commit [f20a30175f] as the behaviour can be trigged on Linux as well. 2015-07-22 09:59:32 +00:00
Roy Marples
0723fb86aa Add a #define to compile ignoring the RA without a public address.
This is set for BSD systems at present so that working systems such as Linux
work by default as designed.
Fixes [f44b3b4817].
2015-07-13 19:05:33 +00:00
Roy Marples
cf16405b87 Replace custom uptime() with clock_gettime(2) calls for more accurate
time handling.
2015-06-29 12:39:44 +00:00
Roy Marples
56db02ab49 Add a guard to ensure failure to send a DHCP release does not cause a double free via re-entering _drop().
Thanks to Todd Blanchard for the analysis.
Fixes [cd38af54ff]
2015-06-24 14:16:05 +00:00
Roy Marples
5b1f21d131 Remove if_oneup and replace with if_afwaited and af_waited.
If present, they will show the address family waiting for.
2015-06-09 19:47:53 +00:00
Roy Marples
edb0ed379d Fix waiting for ip address, [1972d664c2]. 2015-05-20 10:25:10 +00:00
Roy Marples
d40f2f7b8d If we receieve an RA without a public prefix but with the Managed flag set,
ignore the RA until we recieve a DHCPv6 lease with a public address at
which point it is applied.
2015-04-04 21:40:47 +00:00
Roy Marples
573d048785 Replace timeval with timespec. 2015-03-03 17:27:25 +00:00
Roy Marples
bec5000ca4 Reserve space for a fully escaped SSID in the lease filename. 2015-02-10 08:54:33 +00:00
Roy Marples
f9584c9506 Update copyrights to 2015. 2015-01-02 20:03:28 +00:00
Roy Marples
ca867830ab Fix compile warnings without INET or INET6 using gcc. 2014-12-21 19:00:19 +00:00
Roy Marples
f30470407c Allow the same IP address to be leased for different interfaces.
The interface with the lowest metric gets the address.
When that interfaces loses the address, the next valid interface with the
lowest metric gets it.
2014-10-09 18:59:30 +00:00
Roy Marples
369d1314de Rename dhcp6_prefix to delegated_dhcp6_prefix incase a user makes a
DHCPv6 option just called prefix.
Send delegated interfaces to listeners as well.
2014-10-03 17:54:06 +00:00
Roy Marples
a471f5bcd3 Fix compile without -DINET6 2014-09-14 06:53:13 +00:00
Roy Marples
a0011b9933 Only send DHCPv6 and RA to control sockets when DAD has been completed. 2014-09-04 19:55:37 +00:00
Roy Marples
41e9ebebbd Fix the number of interfaces we actually send 2014-09-02 23:41:52 +00:00
Roy Marples
12c77e7591 Support RFC6603 to fix [ac7063e671]. 2014-07-04 19:44:15 +00:00
Roy Marples
ee8a3b3428 Print user defined options via -V 2014-07-03 23:11:00 +00:00
Roy Marples
7182c3e754 Fix gcc unused value error 2014-06-29 02:58:19 +00:00
Roy Marples
bf7db9eced Add the ability to dump DHCPv6 leases.
Control DHCPv4 vs DHCPv6 dumping via the family option.
2014-06-22 13:05:05 +00:00
Roy Marples
717bc86c88 Fix some -Wconversion errors on FreeBSD. 2014-04-25 13:05:15 +00:00
Roy Marples
34457fe661 Add -Wconversion to debug CFLAGS and fix fallout. 2014-03-27 22:14:52 +00:00
Roy Marples
94a79cea05 If not specified, Delegated Prefixes will get an automatic SLA of the
interface index. If the biggest SLA and the assigned prefix fits into a /64
then dhcpcd creates a /64 prefix so that SLAAC works. If bigger than /64
is needed then dhcpcd creates one rounded upto the nearest multiple of 8.

Unless a configured SLA of 0 is assigned, a reject route for the Delegated
Prefix is installed to stop unassigned addresses trying to be resolved upstream.

Addresses added from Delegated Prefixes now have a default address suffix of 1
instead of using a SLAAC style address.
2014-03-22 19:55:29 +00:00
Roy Marples
298c01136e Fix compile without INET or INET6. 2014-02-13 08:15:05 +00:00
Roy Marples
1681b12609 PATH_MAX is too much, lets be more precise 2014-02-12 11:16:22 +00:00
Roy Marples
4eb7b4896f Move all global variables into contexts, with a small exception for
signal handling.
This allows dhcpcd to work better in a threaded environment such as rtems.
2014-02-12 00:39:46 +00:00
Roy Marples
fdff5377bf RFC7083 has new inital timer values. 2014-02-03 11:02:17 +00:00
Roy Marples
776e5fbb8d Add support for the following RFCs:
DHCP SLP Directory Agent, RFC2610
	DHCP Name Service Search, RFC2937
	DHCP PANA Authentication Agent, RFC5192
	DHCP Lost Server, RFC5223
	DHCP CAPWAP, RFC5417
	DHCP Mobility Services, RFC5678
	DHCP SIP UA, RFC6011
	DHCP ANDSF, RFC6153
	DHCP RDNSS Selection for MIF Nodes, RFC6731
	DHCP TFTP Server Address, RFC5859
	DHCP PXELINUX, RFC5071
	DHCP Access Network Domain Name, RFC5986
	DHCP Virtual Subnet Selection, RFC6607
	DHCP Relay Agent Remote-ID, RFC4649
	DHCP Relay Agent Subscriber-ID, RFC4580
	DHCPv6 Relay-ID, RFC5460
	DHCPv6 LIS Discovery, RFC5986
	DHCPv6 SIP UA, RFC6011
	DHCPv6 Network Boot, RFC5970
	DHCPv6 Home Info Discovery in MIPv6, RFC6610
	DHCPv6 RDNSS Selection for MIF Nodes, RFC6731
	DHCPv6 Kerberos, RFC6784
	DHCPv6 Relay-Triggered Reconfiguraion, RFC6977
	DHCPv6 SOL_MAX_RT, RFC7083
2014-02-03 10:28:30 +00:00
Roy Marples
914386bdad Support RECONFIGURE DHCPv6 messages. 2014-01-31 14:25:18 +00:00
Roy Marples
699660fba0 If no status message given, supply a default. 2014-01-29 18:33:43 +00:00
Roy Marples
c73ed17160 Implement RFC 1321 MD5 Message-Digest if not provided in libc.
Implement RFC 2104 HMAC Keyed Hashing.

Implement RFC 3118 Authentication for DHCP Messages
and RFC 3315 Authentication options.
2014-01-25 01:35:53 +00:00
Roy Marples
7a911e57cb Add support for RFC3925 Vendor-Identifying Vendor Options 2013-12-06 17:47:53 +00:00
Roy Marples
ae4e592fa2 Remove hard coded DHCP/DHCPv6 options and then to dhcpcd-definitions.conf
This file replaces dhcpcd-embedded.conf
This actually results in a slightly smaller binary than before and has the
added advantage that the option definitions are now all held within one file.
2013-12-02 16:42:09 +00:00
Roy Marples
1cd05a96d5 Read the embedded config into global values rather than each time
per interface.

Add config toggles to build dhcpcd-embedded.conf into dhcpcd or
to read it at runtime. The build process will now build .c and .h
files based on dhcpcd-embedded.conf and provide defines to reduce
the number or re-allocs if it grows (ie has the full DHCP option list).
2013-11-29 11:15:03 +00:00
Roy Marples
3985931e45 Implement RFC4242, Information Refresh Time Option for DHCPv6. 2013-11-12 17:30:43 +00:00
Roy Marples
a4f05801cd Fix build without INET6 2013-09-05 08:39:38 +00:00
Roy Marples
a8c05b2710 Fix a compile issue on Big Endian machines.
Don't use magic numbers for DHCPv6 FQDN bits.
2013-06-22 09:15:35 +00:00
Roy Marples
a0de5b67f6 Add initial delays as per RFC3315, 17.1.2, 18.1.2 and 18.1.5.
When rebooting an interface, re-request information or abort
the current transaction and re-discover.
2013-06-12 15:01:59 +00:00
Roy Marples
1f4c1525a5 Purge prefix list and routers at start of IPv6 for BSD.
Remove link_addr compact function as we now had a LL address list.
Fix INET and INET6 seperate compiles.
2013-06-10 00:56:54 +00:00
Roy Marples
336dd1b83b Move signal handling into dhcpcd.c
Log the PID of the signal caller
Move syslog functions out of the signal handler if we're not
exiting as it's not safe.
Close existing IPv4 sockets when restarting an interface.
Fix control handling keeping current flags and accepting new ones.
2013-06-07 12:44:19 +00:00
Roy Marples
6bb6f71742 Add support for Rapid Commit, RFC3315 and RFC4039. 2013-06-05 23:57:03 +00:00
Roy Marples
cc3c3560f6 Add DHPCv6 FQDN support (RFC4704)
Improve hostname support in general, so we are aware of hostname changes.
When setting the hostname, prefer the FQDN name or append a domain.
2013-06-05 16:23:24 +00:00
Roy Marples
be2a8dac4e Support the DHCPv6 unicast option. 2013-06-05 10:37:45 +00:00
Roy Marples
22ea2b0deb Automate the assignment of SLA ids if not given for Prefix Delegation.
This means you can just request an ia_pd and let dhcpcd do the rest :)
2013-06-02 09:51:30 +00:00
Roy Marples
d128d95214 Build BOUND routes before DELEGATED ones.
Use const a little more.
2013-05-31 15:01:27 +00:00
Roy Marples
a2258eb383 Remove some const const warnings found by clang. 2013-05-22 22:58:15 +00:00
Roy Marples
d8194bcd39 Check address flags for tentative and duplicates bits for sanity.
Handle the actual trigger to callout dhcpcd-run-hooks in the DAD callback
instead of on receipt of RTM_NEWADDR directly. This is more code, but it allows
us to use our own DAD engine if we need to.
2013-05-16 10:31:21 +00:00
Roy Marples
a8df1b28fb Use the kernel DAD for IPv6 addresses and finish the action once each
address DAD completes. BSD kernels will require a patch as noted within
the README. The linux netlink part still needs to be written.
2013-05-15 10:27:36 +00:00