Commit Graph

301 Commits

Author SHA1 Message Date
Roy Marples
f22fb9b1c1 Clean up compiler warnings from overly pedantic checking. 2009-01-29 13:01:29 +00:00
Roy Marples
146d8134bd Fix compile on BSD. 2009-01-27 19:40:05 +00:00
Roy Marples
fa344ba2b1 Add route removal detection to Linux.
This involved a rejig of the socket code so we can detect
if we removed the route or not.
2009-01-27 18:09:02 +00:00
Roy Marples
495c0a77ac We should include sys/uio.h for writev 2009-01-26 15:15:28 +00:00
Roy Marples
8d471ac125 Fix a valgrid issue and don't call getifssid unless we are wireless. 2009-01-23 01:20:02 +00:00
Roy Marples
8b42788396 Handle stopping and releasing a little better. 2009-01-20 16:33:11 +00:00
Roy Marples
882d97c856 When dropping config, we should punt the old config so we don't drop it twice. 2009-01-19 16:17:18 +00:00
Roy Marples
c008cfb190 Test length, not null. 2009-01-17 00:43:08 +00:00
Roy Marples
97d81cf599 Style. 2009-01-15 15:11:30 +00:00
Roy Marples
5313b78124 --getinterfaces should be more than sufficient for the control socket. 2009-01-15 14:22:40 +00:00
Roy Marples
3d775d8c76 We should use the reason CARRIER as well and run carrier notifications after PREINIT. 2009-01-15 13:31:46 +00:00
Roy Marples
7e5de9cca6 We need to send the terminator also. 2009-01-15 10:12:06 +00:00
Roy Marples
b66d49d386 New configure reasons NOCARRIER and NAK instead of just sending EXPIRE. 2009-01-15 09:30:11 +00:00
Roy Marples
bd487e6c77 Send version length first on the control socket. 2009-01-13 18:03:12 +00:00
Roy Marples
1ba422363a Store the reason we run the script against the interface state.
This enables us to query states via the control socket.
2009-01-13 17:04:28 +00:00
Roy Marples
e467f4b217 Remove the limit for the number of connections to the control socket.
Send the dhcpcd-run-hooks enviornment to listeners on the control socket.
2009-01-12 16:39:01 +00:00
Roy Marples
c347976204 Spelling 2009-01-05 15:50:14 +00:00
Roy Marples
f367dc38be Allow version to be returned over the control interface. 2009-01-05 08:20:53 +00:00
Roy Marples
c53cf4ef4b You can now add a configure block per ssid if the interface is wireless. 2009-01-01 20:51:04 +00:00
Roy Marples
91a44b91b0 Add a static directive that allows the configuration of variables, which
supercedes any DHCP configured variables.
If ip_address is configured then we don't bother with a DHCP 
transaction.
2009-01-01 14:23:36 +00:00
Roy Marples
5f14fcaa61 send_request is no longer a public interface. 2008-12-18 10:25:52 +00:00
Roy Marples
8e06ab4a53 Add the DHS_PROBE state so that we ignore subsequent offers
whilst probing.
2008-12-18 10:23:40 +00:00
Roy Marples
95a12dde2a Probably better to exit here. 2008-11-24 11:21:31 +00:00
Roy Marples
999b21a590 Plug a leak when rebinding interfaces via the control socket. 2008-11-20 10:50:46 +00:00
Roy Marples
a2328d2ddd BOOTP fixes. Also, we don't write a BOOTP lease file. 2008-11-20 09:57:46 +00:00
Roy Marples
299662da4f We are now a BOOTP client also :) 2008-11-19 15:48:18 +00:00
Roy Marples
5f1643f584 Fix working with linux aliased interfaces again. 2008-11-17 22:50:37 +00:00
Roy Marples
c989b02361 We no longer send a ClientID by default. This is so we now mirror the kernel DHCP client and can re-use its lease by default. To retain the old behaviour, simply add clientid to dhcpcd.conf. 2008-11-17 17:25:54 +00:00
Roy Marples
228181a811 Whitespace. 2008-11-17 12:48:38 +00:00
Roy Marples
7b9d0731c3 Fork into background even with no interfaces IF we are asked to background AND have link detection. 2008-11-15 11:24:26 +00:00
Roy Marples
e6be43482d Report all interfaces requested that do not exist. 2008-11-14 20:38:40 +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
3ad4d331af Fix some LINT errors. 2008-11-10 11:15:27 +00:00
Roy Marples
5b7112f525 Test should always DISCOVER. 2008-11-04 10:13:07 +00:00
Roy Marples
6d35d0ccf9 Ensure inform options are terminated. 2008-10-18 22:57:40 +00:00
Roy Marples
eae4f5b472 Get INFORM support almost working again. 2008-10-18 16:41:19 +00:00
Roy Marples
aec7d71ddb Use the existing start_reboot function instead of a start_request. 2008-10-18 10:52:01 +00:00
Roy Marples
49c0efdadb Make init request for an address work off the command line again. 2008-10-18 10:02:36 +00:00
Roy Marples
35a8183fb9 static objects are initialized to 0 by default, so don't explicity do this. 2008-10-06 12:45:32 +00:00
Roy Marples
079649b0b1 We should be able to reboot interfaces we don't already know about. 2008-10-06 08:37:02 +00:00
Roy Marples
764eb12abd Fix TEST. 2008-10-01 11:15:33 +00:00
Roy Marples
5c39a95174 Fix pointer. 2008-09-17 10:37:03 +00:00
Roy Marples
b2173751b6 Fix rebooting off a signal. 2008-09-17 08:29:56 +00:00
Roy Marples
2662d5195f Allow the release keyword in dhcpcd.conf to release the lease on shutdown. 2008-09-16 13:17:23 +00:00
Roy Marples
4f35e21b38 Fix segfault when passing options in. 2008-09-15 16:43:57 +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
c4f493792c We need to drop config on carrier loss now. 2008-09-13 11:17:24 +00:00
Roy Marples
be070f751b Drop interfaces in reverse order when stopping and handle removal of interfaces in one function. 2008-09-11 22:55:27 +00:00
Roy Marples
c4012b7e1b Fix removing old config. 2008-09-11 15:50:19 +00:00
Roy Marples
ba97e49417 Add allowinterfaces and denyinterfaces options to dhcpcd.conf for better multiple interface support. 2008-09-11 09:38:02 +00:00
Roy Marples
03c2c87907 Allow quiet and nobackground to work in dhcpcd.conf 2008-09-11 08:28:39 +00:00
Roy Marples
2b60ecb71e Sort interfaces according to preference and pass this to dhcpcd-run-hooks so we can prefer configs. 2008-09-09 17:07:48 +00:00
Roy Marples
c130b44207 Fix renewing. 2008-09-08 11:28:12 +00:00
Roy Marples
64c6e1eb18 Check carrier when starting reboot. 2008-09-06 19:41:05 +00:00
Roy Marples
08aa777660 Style. 2008-09-06 19:24:40 +00:00
Roy Marples
4521897e25 Should use LOG_DAEMON as we're a DHCP Client Daemon 2008-09-05 19:44:02 +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
f25f3fb214 Don't spam on startup about unsupported interfaces if quiet. 2008-09-05 15:46:02 +00:00
Roy Marples
fca060b851 Save more memory, malloc the pidfile. 2008-09-05 14:16:53 +00:00
Roy Marples
9f7780b07b Don't use a needless buffer for cffile. 2008-09-05 13:28:44 +00:00
Roy Marples
f6de5860b6 As our logger calls emulate syslog, we can use %m. However, this means we have to convert it for printf as POSIX does not require that printf supports it. This also means we drop -pedantic from our GCC flags. 2008-09-05 13:12:35 +00:00
Roy Marples
0ce8caf249 Mark functions as _noreturn. 2008-09-05 11:46:03 +00:00
Roy Marples
e7eeaf88da Make TEST work once more. 2008-09-05 07:31:09 +00:00
Roy Marples
da16617840 Remove some ints and replace with our option mask. 2008-09-05 07:22:03 +00:00
Roy Marples
ef10669432 Ensure background is initialised. 2008-09-04 22:02:32 +00:00
Roy Marples
15eb50d78c Make background work again. 2008-09-04 15:24:55 +00:00
Roy Marples
064dd58ee2 Enable detection of addition and removal of interfaces on Linux. 2008-09-04 14:08:14 +00:00
Roy Marples
96d0673a2c When OS reports new and removed interfaces, dhcpcd sees this and either starts or stops watching them. BSD only, Linux to follow. 2008-09-04 11:30:11 +00:00
Roy Marples
4570862e65 If we fail to send a packet, remove the interface from consideration. 2008-09-04 09:43:52 +00:00
Roy Marples
25312cdd58 No need to be this complicated. 2008-09-04 08:27:38 +00:00
Roy Marples
f65dc4f659 Ensure that clientid is free before reallocing it. 2008-09-04 08:20:26 +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
b24e474272 strncpy -> strlcpy. 2008-09-02 15:07:01 +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
78593b95f4 Fix CMDLINE_COMPAT. 2008-08-25 07:34:10 +00:00
Roy Marples
0235df9d66 Move the --renew option to --rebind as it's more accurate (both are -n). Support --renew when CMDLINE_COMPAT is enabled. 2008-08-20 08:50:38 +00:00
Roy Marples
9eef54d82c Fix some config reading. 2008-08-18 12:46:18 +00:00
Roy Marples
cc45fbd76e The require directive now requires that the required options are present in each DHCP message. A few variables and functions have also been renamed to make this part more readable. 2008-08-18 12:43:05 +00:00
Roy Marples
e77d58d958 Fix compat. 2008-08-15 19:29:24 +00:00
Roy Marples
68e04b4438 Re-jig the order of doing things to improve our logging. 2008-08-14 16:16:06 +00:00
Roy Marples
50b9957e82 Don't warn about dhcpcd not running when using --renew. 2008-08-14 16:00:37 +00:00
Roy Marples
7b1ae6d97b classid -> vendorclassid to match the RFC description. 2008-08-13 21:29:30 +00:00
Roy Marples
43ea14b85c Fix segfault. 2008-08-13 17:06:02 +00:00
Roy Marples
7375b68c26 Scrub compile warnings on FreeBSD. 2008-08-13 15:09:13 +00:00
Roy Marples
16ceedbb2d Fix -n when already running. 2008-08-12 23:56:09 +00:00
Roy Marples
d99ed6bd0c Need time.h for nanosleep. 2008-08-12 12:20:25 +00:00
Roy Marples
6607ae4ba7 Spin until dhcpcd exits (timeout 10 seconds) to avoid this race:- dhcpcd -x eth0; dhcpcd eth0 2008-08-12 10:51:42 +00:00
Roy Marples
523f398e5e Remove loads of code specific to fork()less systems. dhcpcd no longer backgrounds on these systems, but is a lot lighter. 2008-08-11 08:32:52 +00:00
Roy Marples
37e7de1899 DHCP_option -> DHO_option. 2008-08-08 17:55:48 +00:00
Roy Marples
9e4fa6b479 We should not make any restrictions on hostname. RFC2131 says that hostname field *could* be fully or partially qualified. 2008-08-08 13:47:57 +00:00
Roy Marples
caf08c91c9 Ensure that hostname does not begin with a . 2008-08-08 12:26:05 +00:00
Roy Marples
e837a67042 Note that we encode the hostname according to RFC1035. As such, we can't use the system defined MAX hostname length. 2008-08-07 10:15:15 +00:00
Roy Marples
14b5ef555c Allow disable for fqdn option so command line can override config. 2008-08-06 08:31:20 +00:00
Roy Marples
7f692d054c Remove the MINIMAL define. 2008-08-06 08:28:43 +00:00
Roy Marples
1674a06773 Put options in correct order. 2008-08-05 22:06:45 +00:00
Roy Marples
3ca9152f44 Use correct hostname length. 2008-08-05 22:06:11 +00:00
Roy Marples
121c3dce00 stderr should be unbuffered by default. 2008-07-30 21:27:48 +00:00
Roy Marples
5a2cb5bcaf Use setlinebuf() at startup instead of calling fflush() for each logger call. 2008-07-28 15:43:38 +00:00
Roy Marples
eceefd5554 Add -X, --blacklist option to reject DHCP messages with a matching serverid. 2008-07-28 13:21:47 +00:00
Roy Marples
b8b4be9a39 Remove #ifdefs to disable specific bits of code. We now build everything - we're small enough :) 2008-07-23 17:06:42 +00:00