summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-11-15 11:24:26 +0000
committerRoy Marples <roy@marples.name>2008-11-15 11:24:26 +0000
commit7b9d0731c3ac128498c7110f1e1f1e8d0868c820 (patch)
tree12b0381ec5b0db28ca92fc0b63adb6032b027786 /dhcpcd.c
parente6be43482df2b919a1c6f15e95d83708c110382d (diff)
downloaddhcpcd-7b9d0731c3ac128498c7110f1e1f1e8d0868c820.tar.xz
Fork into background even with no interfaces IF we are asked to background AND have link detection.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index d82c5eb0..f34d4d86 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1312,12 +1312,19 @@ main(int argc, char **argv)
if (strcmp(iface->name, ifv[i]) == 0)
break;
if (!iface)
- syslog(LOG_ERR, "%s: invalid interface", ifv[i]);
+ syslog(LOG_ERR, "%s: interface not found or invalid",
+ ifv[i]);
}
if (!ifaces) {
if (ifc == 0)
syslog(LOG_ERR, "no valid interfaces found");
- exit(EXIT_FAILURE);
+ if (!(options & DHCPCD_BACKGROUND) ||
+ !(options & DHCPCD_LINK))
+ {
+ syslog(LOG_ERR, "aborting as we're not backgrounding"
+ " with link detection");
+ exit(EXIT_FAILURE);
+ }
}
if (options & DHCPCD_BACKGROUND)