Commit Graph

42 Commits

Author SHA1 Message Date
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
c6eb161be2 Implement support for RFC 3203, FORCERENEW message. 2014-01-31 11:47:27 +00:00
Roy Marples
b64cef1bfd Fix compile 2014-01-29 14:16:31 +00:00
Roy Marples
d4154ba7a8 Add nodhcp and nodhcp6 directives.
Thanks to Sebastian Huber for the initial patch and testing.
2014-01-29 14:05:58 +00:00
Roy Marples
322ebc208b Ensure that config.h or common.h is the first included local header.
Thanks to Sebastian Huber.
2014-01-24 11:09:39 +00:00
Roy Marples
5979b60841 Clarify IPv4LL defence failure. 2014-01-21 13:40:33 +00:00
Roy Marples
8cc47ba26d White space police 2013-04-04 20:31:04 +00:00
Roy Marples
10e17e3f63 Remove xzalloc function 2013-02-15 21:45:08 +00:00
Roy Marples
95fdd136ae Move if_state into interface->if_data as dhcp_state.
This should reduce memory usage for non IPv4 interfaces.
2013-02-03 22:55:45 +00:00
Roy Marples
5dc65f77b3 Move ipv4 specific infos from interface to if_state. 2013-02-03 14:52:24 +00:00
Roy Marples
294eff4df4 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.
2013-02-02 14:05:55 +00:00
Roy Marples
760780dd5c Use a proper namespace for IPv4LL 2012-11-13 11:44:20 +00:00
Roy Marples
9eb6e8dc94 Use a proper namespace for eloop 2012-11-13 11:25:51 +00:00
Roy Marples
8273ac5a42 Fix copyright dates 2011-12-15 02:41:10 +00:00
Roy Marples
91cd732493 Add an implementation of an IPv6 Router Solicitor as specified in
RFC6016 with regards to RDNSS and DNSSL.
2011-12-15 02:35:47 +00:00
Roy Marples
1876157a45 Update some copyrights. 2011-03-24 18:08:16 +00:00
Roy Marples
c06fa755a2 Clear timeouts on IPv4LL failure. 2010-05-26 07:13:23 +00:00
Roy Marples
f3870b2ccc Fix IPv4LL defending and add a bit more logging. 2010-05-12 16:20:55 +00:00
Roy Marples
716f288882 When trying IPv4LL from a DHCP lease with an IPv4LL address, just
use the address and nothing else.
2010-02-26 15:06:51 +00:00
Roy Marples
bdeff18fc4 Deleting all timeouts for the interface is better. 2010-02-26 13:46:07 +00:00
Roy Marples
207d7b4fac Clear timeouts when starting ipv4ll. 2010-02-26 13:41:38 +00:00
Roy Marples
1cc00d8a7c Allow IPv4LL address range to be configured by DHCP.
We now check the message for a DHCP cookie instead of the address
assigned to test for local link.
2010-02-17 22:23:17 +00:00
Roy Marples
5fff28a154 Replace the mk stubs with a autotools like configure script.
Split compat libc functions out into subdir.
2009-07-14 13:59:30 +00:00
Roy Marples
601fb3d500 Add (c) to Copyright 2009-05-01 13:57:45 +00:00
Roy Marples
eab2229cfa Enforce NetBSD KNF style more 2009-02-11 17:56:22 +00:00
Roy Marples
10bcbb5d6b When declining a DHCP lease and we have an IPv4LL one, don't re announce our IPv4LL lease. 2008-11-14 09:39:09 +00:00
Roy Marples
a2a9a498da Reboot off the last lease and use the last lease if not expired and user has asked for it. Also, add a reboot timeout toggle (default 10 seconds). 2008-09-15 15:23:46 +00:00
Roy Marples
765fbf7db0 Remove logger and exclusively uses syslog instead. This saves almost 2K on NetBSD/amd64 from before changing strerror to %m. 2008-09-05 18:24:34 +00:00
Roy Marples
f43e585355 Add a control socket so that interfaces can be dynamically re-set.
This requires the event loop argument being changed to void *
so we can send arguments other than an interface.
2008-09-03 16:49:28 +00:00
Roy Marples
fd05b7dcfc Add an event loop.
Split client.c into smaller files and functions and
recode around the event loop.
Add multiple interface support using the new event loop.
Document changes and outstanding bugs.
2008-09-02 13:28:11 +00:00
Roy Marples
1a60d14fa2 Normally I hate massive code drops, but heh.
The code has been drastically re-arranged.
Instead of populating a custom structure while parsing dhcp messages, we now pluck what we need right out of the message itself. We have custom functions and a lookup table to make this really easy.
This makes us more like dhclient and udhcpc, and will enable us to easily add (and remove!) more dhcp options without having to actually change the code (much).
We now store the real dhcp message we got in /var/db/dhcpcd-$iface.lease, the mtime of the file being used as when we got the lease. This file is read in when re-using an old lease instead of parsing the .info file.
The benefit of all of this means that we're actually ~15k smaller when compiled with the same features.
This has been tested for quite some time, and I'm pretty sure most bugs with the 3.2 branch have been fixed whilst making this. Right now, we are 99% command line compatible with the 3.2 branch.
2008-04-11 16:14:55 +00:00
Roy Marples
8d21242476 Change code style to match the BSDs in the hope the might adpot it instead of dhclient. 2008-03-20 16:47:51 +00:00
Roy Marples
dc9be8a47f Quiet some lint warnings. 2008-01-21 21:19:53 +00:00
Roy Marples
f4db036104 Prefer for (;;) over while (1) 2008-01-21 16:08:42 +00:00
Roy Marples
2f736fb7ce Re format for standard tabs. 2008-01-16 16:38:47 +00:00
Roy Marples
782830eb5d Belatedly into 2008 :) 2008-01-08 09:51:23 +00:00
Roy Marples
b6057d10d2 Re-license as 2-clause BSD as I've re-written everything from the old dhcpcd-2 code base now. 2007-11-15 11:35:53 +00:00
Roy Marples
1f8f3dbdc1 Reword the headers to just say we use the GPLv2. 2007-11-07 16:26:41 +00:00
Roy Marples
cfe160119d Update my e-mail address as I have retired from Gentoo. 2007-11-06 15:03:38 +00:00
Roy Marples
24878742f8 Increase ipv4ll lease time to 20 seconds so we attempt a dhcp request every 10 seconds 2007-10-23 09:07:58 +00:00
Roy Marples
9bb2bc68e9 Return on all errors 2007-10-11 13:21:02 +00:00
Roy Marples
77659ce035 We now do ARP checking by default as recommended by RFC 2131.
Add RFC 3927 (aka IPV4LL aka APIPA) support by default.
2007-07-18 11:26:59 +00:00