]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: Improve error when interface does not exist vs invalid config
authorRoy Marples <roy@marples.name>
Tue, 17 Mar 2020 07:57:03 +0000 (07:57 +0000)
committerRoy Marples <roy@marples.name>
Tue, 17 Mar 2020 07:57:03 +0000 (07:57 +0000)
src/dhcpcd.c

index bf5d74c38c8cbb20b53cf6ff7547f90fda848b85..bd2556eaa04469f9ad4d7472b5d2af37bdf007c9 100644 (file)
@@ -2173,9 +2173,11 @@ printpidfile:
                goto exit_failure;
        }
        for (i = 0; i < ctx.ifc; i++) {
-               if ((ifp = if_find(ctx.ifaces, ctx.ifv[i])) == NULL ||
-                   !ifp->active)
-                       logerrx("%s: interface not found or invalid",
+               if ((ifp = if_find(ctx.ifaces, ctx.ifv[i])) == NULL)
+                       logerrx("%s: interface not found",
+                           ctx.ifv[i]);
+               else if (!ifp->active)
+                       logerrx("%s: interface has an invalid configuration",
                            ctx.ifv[i]);
        }
        TAILQ_FOREACH(ifp, ctx.ifaces, next) {