From: Roy Marples Date: Wed, 19 Jun 2013 08:57:23 +0000 (+0000) Subject: Fix operation on NetBSD X-Git-Tag: v6.0.0~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=303a7054122be1b118f2d384631a683171ec3864;p=thirdparty%2Fdhcpcd.git Fix operation on NetBSD --- diff --git a/dhcp6.c b/dhcp6.c index 02b3f99f..d7ba7789 100644 --- 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);