]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Check we actually have options allocated before adding commandline options.
authorRoy Marples <roy@marples.name>
Fri, 6 May 2016 20:44:24 +0000 (20:44 +0000)
committerRoy Marples <roy@marples.name>
Fri, 6 May 2016 20:44:24 +0000 (20:44 +0000)
dhcpcd.c

index 2c38bc765194d296512c3939c6f671d244f7d2ff..68b80537388103720f17477ac96d77a2b16d5a4a 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -592,12 +592,14 @@ configure_interface(struct interface *ifp, int argc, char **argv,
 
        old = ifp->options ? ifp->options->mtime : 0;
        dhcpcd_selectprofile(ifp, NULL);
+       if (ifp->options == NULL)
+               return;
        add_options(ifp->ctx, ifp->name, ifp->options, argc, argv);
        ifp->options->options |= options;
        configure_interface1(ifp);
 
        /* If the mtime has changed drop any old lease */
-       if (ifp->options && old != 0 && ifp->options->mtime != old) {
+       if (old != 0 && ifp->options->mtime != old) {
                logger(ifp->ctx, LOG_WARNING,
                    "%s: confile file changed, expiring leases", ifp->name);
                dhcpcd_drop(ifp, 0);