Commit Graph

556 Commits

Author SHA1 Message Date
Roy Marples
bce64b1524 Improve startup with regards to carrier checking and adding a link-local
IPv6 address.
2014-06-30 15:43:58 +00:00
Roy Marples
942a8ffcf7 Add debugging messages for interface arrival/departure.
Only init state and run preinit for new interfaces.
2014-06-30 11:28:14 +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
c9ce5cc4ff Ensure we init before forking, but run the preinit scripts afterwards 2014-06-05 13:03:49 +00:00
Roy Marples
2612c7f005 Ensure OWN is set by SLAAC private before initing.
Add a link-local address before running any PREINIT script
as well as at start incase a 3rd party removed it.
Move kernel tweaks to RA to DEBUG messages.
2014-06-05 11:38:04 +00:00
Roy Marples
d05215aa28 Add an IPv6 link-local address before upping the interface if needed.
Bring an interface up when we start it and not during discovery.
As such, stop waiting on carrier for a second if we did.
2014-06-04 23:54:15 +00:00
Roy Marples
1aeaf0e751 Default SLAAC to use RFC7271 addresses.
Create an IPv6 link-local address if non exists at startup using the
configured SLAAC method.
2014-06-04 20:27:40 +00:00
Roy Marples
c85baeae3e -4 and -6 are now mutually exclusive and when running on a single interface
per protocol pidfiles are created.
This means that other control options suchs as -x and -n will require the
-4 or -6 option as well.
2014-05-29 12:52:27 +00:00
Roy Marples
eb33667132 Add a compat syslog function if the libc syslog does not support LOG_PERROR.
Add a non working if-sun.c stub.
Define IN6_IFF_TENTATIVE and friends to zero so IPv6 at least compiles on Solaris.
Warn that Solaris support presently does not work.
2014-05-24 13:08:29 +00:00
Roy Marples
26c177737e Source now compiles on Solaris, just missing the if-sun.c support so
linking fails.
2014-05-21 23:07:52 +00:00
Roy Marples
047235d751 If a DHCPv6 lease expires as well as all IPv6 routers who want DHCPv6, don't restart discover. 2014-05-19 00:49:14 +00:00
Roy Marples
0b32a745d3 Only remove the interface from the list once all callouts have been
completed.
2014-05-16 15:03:28 +00:00
Roy Marples
4afb9c4336 Run NOCARRIER before dropping protocols. 2014-05-07 09:22:26 +00:00
Roy Marples
67616a589a Add the interface to our list before initing state. 2014-05-06 18:14:43 +00:00
Roy Marples
b4304101ee Always send a carrier as it's no longer encapsulated in the IPv4 stack.
When stopping and not departed, run with the STOPPED reason but do
not process it in hooks.
2014-05-06 14:42:24 +00:00
Roy Marples
e61b2a429f Fix writing interfaces to control socket. 2014-05-04 22:48:43 +00:00
Roy Marples
68e672702b Change the readrawsocket API a little so that we know when EOF is reached.
This allows us to remove the non blocking option from our sockets due to the way BPF works.
2014-05-02 23:54:29 +00:00
Roy Marples
94cb985a8e Log any errors sending the interface afer a getinterfaces call. 2014-05-02 20:57:21 +00:00
Roy Marples
c68ed24a38 Remove debug 2014-04-30 14:14:03 +00:00
Roy Marples
7cf6ba7ec3 Support ND6_IFF_OVERRIDE_RTADV 2014-04-30 14:13:22 +00:00
Roy Marples
7ec6b74bea Sorting interfaces is an IPv4 specific task, so move it into ipv4.c 2014-04-28 12:47:33 +00:00
Roy Marples
94bec97280 Namespace all public dhcpcd.c functions.
Add ipv4, ipv6, dhcp and dhcp6 options to re-enable if disabled globally.
Try and load a delegated interface if not running on all interfaces.
Fix delegated interfaces without a prefix set.
2014-04-28 12:02:12 +00:00
Roy Marples
1a7ff10050 Move net.c to if.c.
Ensure that if.c and if-KERNEL.c are namespaced correctly.
2014-04-25 10:42:37 +00:00
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