summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-10-03 20:07:52 +0000
committerRoy Marples <roy@marples.name>2016-10-03 20:07:52 +0000
commitd77196c1ef97c0fe30ef192f4355b336f6971550 (patch)
tree1c167cc352435a15fafbe0d9f87d4f7756e013cd /dhcpcd.c
parent97da47ded2029783f906fc9f7a6f069de49aec9a (diff)
downloaddhcpcd-d77196c1ef97c0fe30ef192f4355b336f6971550.tar.xz
Guard against the possibility of no config..... may fix [c9d04817fa].
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 8f1862b2..7e58c7e7 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -596,8 +596,11 @@ configure_interface(struct interface *ifp, int argc, char **argv,
old = ifp->options ? ifp->options->mtime : 0;
dhcpcd_selectprofile(ifp, NULL);
- if (ifp->options == NULL)
+ if (ifp->options == NULL) {
+ /* dhcpcd cannot continue with this interface. */
+ ifp->active = IF_INACTIVE;
return;
+ }
add_options(ifp->ctx, ifp->name, ifp->options, argc, argv);
ifp->options->options |= options;
configure_interface1(ifp);
@@ -671,7 +674,8 @@ dhcpcd_initstate1(struct interface *ifp, int argc, char **argv,
{
configure_interface(ifp, argc, argv, options);
- dhcpcd_initstate2(ifp, 0);
+ if (ifp->active)
+ dhcpcd_initstate2(ifp, 0);
}
static void
@@ -983,9 +987,13 @@ dhcpcd_activateinterface(struct interface *ifp, unsigned long long options)
if (!ifp->active) {
ifp->active = IF_ACTIVE;
dhcpcd_initstate2(ifp, options);
- configure_interface1(ifp);
- run_preinit(ifp);
- dhcpcd_prestartinterface(ifp);
+ /* It's possible we might not have been able to load
+ * a config. */
+ if (ifp->active) {
+ configure_interface1(ifp);
+ run_preinit(ifp);
+ dhcpcd_prestartinterface(ifp);
+ }
}
}