]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fork into background even with no interfaces IF we are asked to background AND have...
authorRoy Marples <roy@marples.name>
Sat, 15 Nov 2008 11:24:26 +0000 (11:24 +0000)
committerRoy Marples <roy@marples.name>
Sat, 15 Nov 2008 11:24:26 +0000 (11:24 +0000)
dhcpcd.c

index d82c5eb0d4445d9d2cd567048e05cfe7f8828fba..f34d4d867f832b1afbbf7b9f85d39398e26adc90 100644 (file)
--- 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)