Commit Graph

533 Commits

Author SHA1 Message Date
Roy Marples
0e2177c64e Fix compat/queue.h 2014-04-23 20:29:03 +00:00
Roy Marples
fbc3019cc1 Work with older libc's without O_CLOEXEC. 2014-04-18 13:17:42 +00:00
Roy Marples
34457fe661 Add -Wconversion to debug CFLAGS and fix fallout. 2014-03-27 22:14:52 +00:00
Roy Marples
9cf6e1039b More fixes to dhcp dumping leases.
When running dump and test hooks, exit early to allow as non root.
2014-03-11 22:37:10 +00:00
Roy Marples
f970fb668e Ensure that -M -x ifname does the right thing. 2014-03-11 10:41:27 +00:00
Roy Marples
af975e6853 Only check for carrier if state is still unknown. 2014-03-07 22:14:13 +00:00
Roy Marples
b317418153 Add -M, --master to force dhcpcd into master mode. 2014-03-07 10:22:37 +00:00
Roy Marples
7af0ae84c2 Rationalise signal handling - HUP now rebinds, ALRM now releases, USR1 reapplies config. 2014-03-07 10:08:58 +00:00
Roy Marples
9f30172bd6 Deleting IPv4 subnet routes and IPv6 prefixes now works on OpenBSD. 2014-03-06 22:29:26 +00:00
Roy Marples
ad6a36d4f3 Initial support for OpenBSD interface and routing priority. 2014-03-06 14:41:58 +00:00
Roy Marples
c8b42ae14d Compile and work on OpenBSD.
However, there is a problem deleting both IPv4 and IPv6 subnet routes.
Also, there is a problem opening a BPF fd in non blocking mode directly and
posix_spawn(3) fails to work so we block that in configure.
2014-03-05 18:11:22 +00:00
Roy Marples
4145d2b68a Expire DHCP lease and then run no carrier as a seperate operation.
Instead of waiting the maximum amount of time to report DAD failure/completion, poll the address flags periodically.
2014-03-03 12:10:58 +00:00
Roy Marples
8fc52ced6f Fix all errors reported by clang static analyser. 2014-02-27 20:00:39 +00:00
Roy Marples
2e0740acd3 Report interface carrier state to the dhcpcd-run-hooks as ifcarrier.
If ifcarrier is up, don't start wpa_supplicant.
2014-02-27 10:52:11 +00:00
Roy Marples
1989cad379 Don't use a variable length buffer 2014-02-25 14:11:35 +00:00
Roy Marples
929895ed29 Respect initial commandline arguments when rebooting via a signal. 2014-02-25 10:24:01 +00:00
Roy Marples
658bfd5e0c Fix arping moving to the next test if we find the IP address
but do not have a profile for it.
Thanks to David McGurty for the analysis.
2014-02-24 14:40:29 +00:00
Roy Marples
6618e7ea8b Add a USE_SIGNALS define.
If we're not using signals then we also create a control socket in the
non MASTER case. We then use this to communicate instead of signals.
2014-02-21 16:10:55 +00:00
Roy Marples
0d033d1791 Fix FreeBSD compile warnings. 2014-02-13 13:23:43 +00:00
Roy Marples
2433e54dc8 Ensure we close the contol socket if we fail to connect.
Don't crash when closing IPv6ND or DHCPv6 when not the IPv6 protocol is
not started.
2014-02-12 20:51:57 +00:00
Roy Marples
d733d75a89 No need to malloc pidfile. 2014-02-12 11:55:43 +00:00
Roy Marples
e9882fb08a Ensure we remove the socket from the eloop event queue before closing it. 2014-02-12 10:29:06 +00:00
Roy Marples
63d4472589 Fix compile on BSD 2014-02-12 09:25:58 +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
59a555cd3d Fix writing the pidfile and cleaning up a bit better. 2014-02-08 10:36:38 +00:00
Roy Marples
d074b2494f Move vendor out of global scope. 2014-02-08 00:29:02 +00:00
Roy Marples
c1b54b57cb get_line is now static inside of if-options.c and is a simple wrapper around getline(3). 2014-02-07 21:48:24 +00:00
Roy Marples
faaa132c33 Use fscanf instead of get_line when parsing /proc/cpuinfo 2014-02-07 20:31:29 +00:00
Roy Marples
ebc8827ae5 writepid is now a static inline function 2014-02-07 17:48:13 +00:00
Roy Marples
cc0502023e Remove custom set_cloexec and set_nonblock functions.
Instead pass O_CLOEXEC or SOCK_CLOEXEC to open, socket, etc.
This requires a fairly modern system.
2014-02-07 17:32:08 +00:00
Roy Marples
159ebbcf18 Use our own signal structure instead of siginfo_t to save space. 2014-02-07 15:49:33 +00:00
Roy Marples
01096a4f63 Copy the siginfo_t structure onto a global copy and pass that as an
argument to eloop_timeout_add_now so that every actionis async signal safe.
2014-02-07 14:39:22 +00:00
Roy Marples
c7c1e4112a Don't hold onto an AF_INET socket for the duration of the program,
open and close it as required.
2014-02-07 11:03:39 +00:00
Roy Marples
1f2c54e008 Exit correctly if no interfaces have a carrier. 2014-02-07 09:33:32 +00:00
Roy Marples
623e5af396 pidfd can be static now. 2014-02-05 13:18:58 +00:00
Roy Marples
9c8b417d8a Move control globals into a context. 2014-02-05 12:01:09 +00:00
Roy Marples
cff708ad3b Only return 0 from daemonise if we have forked successfully, otherwise the pid of the child. 2014-02-04 15:53:56 +00:00
Roy Marples
b5b066a566 Fork correctly from RA and DAD. 2014-02-04 15:46:38 +00:00
Roy Marples
a9d78def54 Remove DEBUG_MEMORY guard and always free memory and resources.
Remove all atexit(3) and exit(3) calls, instead exiting via the eloop.
2014-02-04 14:39:26 +00:00
Roy Marples
c6eb161be2 Implement support for RFC 3203, FORCERENEW message. 2014-01-31 11:47:27 +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
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
3582c56dcd Add prefix to copyright constant.
Thanks to Sebastian Huber.
2014-01-24 11:00:38 +00:00
Roy Marples
9ff636a5c7 IAID must be used within an interface block.
IA_PD must be used within an interface block.
You cannot assign a delegated prefix to the requesting interface.
2014-01-18 14:49:29 +00:00
Roy Marples
d1c384a686 Welcome to 2014! Relese dhcpcd-6.2.0. 2014-01-03 21:12:19 +00:00
Roy Marples
7a911e57cb Add support for RFC3925 Vendor-Identifying Vendor Options 2013-12-06 17:47:53 +00:00
Roy Marples
b7f5d1db5b Fix a few memory leaks, DHCPv6 prefix definition and the -V option. 2013-12-03 23:10:21 +00:00
Roy Marples
d9fbb11875 Fix a crash freeing our embedded config 2013-12-02 20:45:19 +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