summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2013-08-31 16:48:39 +0000
committerRoy Marples <roy@marples.name>2013-08-31 16:48:39 +0000
commit7013b07382b7a2aa63115d75fc6724bedf199a9c (patch)
treea3329f8d274112f66bf5d1ba7cdb0f4dc0f251d4 /dhcpcd.c
parenta544b76a69516341f1134f2dd04d8dcde1ff0868 (diff)
downloaddhcpcd-7013b07382b7a2aa63115d75fc6724bedf199a9c.tar.xz
Add 4 and 6 arguments to the waitip command so that you can specify
which protocols to wait for.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index d410c4a0..ba5c5180 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -206,6 +206,23 @@ daemonise(void)
char buf = '\0';
int sidpipe[2], fd;
+ if (options & DHCPCD_DAEMONISE && !(options & DHCPCD_DAEMONISED)) {
+ if (options & DHCPCD_WAITIP4 &&
+ !ipv4_addrexists(NULL))
+ return -1;
+ if (options & DHCPCD_WAITIP6 &&
+ !ipv6nd_addrexists(NULL) &&
+ !dhcp6_addrexists(NULL))
+ return -1;
+ if ((options &
+ (DHCPCD_WAITIP | DHCPCD_WAITIP4 | DHCPCD_WAITIP6)) ==
+ DHCPCD_WAITIP &&
+ !ipv4_addrexists(NULL) &&
+ !ipv6nd_addrexists(NULL) &&
+ !dhcp6_addrexists(NULL))
+ return -1;
+ }
+
eloop_timeout_delete(handle_exit_timeout, NULL);
if (options & DHCPCD_DAEMONISED || !(options & DHCPCD_DAEMONISE))
return 0;