]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix operation on NetBSD
authorRoy Marples <roy@marples.name>
Wed, 19 Jun 2013 08:57:23 +0000 (08:57 +0000)
committerRoy Marples <roy@marples.name>
Wed, 19 Jun 2013 08:57:23 +0000 (08:57 +0000)
dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index 02b3f99f262a070a0175ceb25f623e8eca034aaa..d7ba778952d245e7f043334f1d1f940d391c2e1a 100644 (file)
--- a/dhcp6.c
+++ b/dhcp6.c
@@ -689,9 +689,11 @@ static void dhcp6_delete_delegates(struct interface *ifp)
 {
        struct interface *ifp0;
 
-       TAILQ_FOREACH(ifp0, ifaces, next) {
-               if (ifp0 != ifp)
-                       dhcp6_freedrop_addrs(ifp0, 1, ifp);
+       if (ifaces) {
+               TAILQ_FOREACH(ifp0, ifaces, next) {
+                       if (ifp0 != ifp)
+                               dhcp6_freedrop_addrs(ifp0, 1, ifp);
+               }
        }
 }
 
@@ -2407,7 +2409,8 @@ dhcp6_freedrop(struct interface *ifp, int drop, const char *reason)
         * the same name or index so think very hard before changing
         * this.
         */
-       if (ifp->options->options & (DHCPCD_STOPPING | DHCPCD_RELEASE))
+       if (ifp->options &&
+           ifp->options->options & (DHCPCD_STOPPING | DHCPCD_RELEASE))
                dhcp6_delete_delegates(ifp);
 
        state = D6_STATE(ifp);