From: Roy Marples Date: Mon, 24 Apr 2017 16:53:05 +0000 (+0100) Subject: sla could be NULL, so check that. X-Git-Tag: v7.0.0-rc1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4abbbfba6986bec13b6ca46938e8c5a39dbaeef2;p=thirdparty%2Fdhcpcd.git sla could be NULL, so check that. --- diff --git a/src/dhcp6.c b/src/dhcp6.c index e2588069..dfa8d91d 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -2416,7 +2416,7 @@ dhcp6_ifdelegateaddr(struct interface *ifp, struct ipv6_addr *prefix, if (strcmp(ifp->name, prefix->iface->name) == 0) { if (prefix->prefix_exclude_len == 0) { /* Don't spam the log automatically */ - if (sla) + if (sla != NULL) logwarnx("%s: DHCPv6 server does not support " "OPTION_PD_EXCLUDE", ifp->name); @@ -2428,14 +2428,14 @@ dhcp6_ifdelegateaddr(struct interface *ifp, struct ipv6_addr *prefix, sla, if_ia)) == -1) return NULL; - if (fls64(sla->suffix) > 128 - pfxlen) { + if (sla != NULL && fls64(sla->suffix) > 128 - pfxlen) { logerrx("%s: suffix %" PRIu64 " + prefix_len %d > 128", ifp->name, sla->suffix, pfxlen); return NULL; } /* Add our suffix */ - if (sla->suffix) { + if (sla != NULL && sla->suffix != 0) { daddr = addr; vl = be64dec(addr.s6_addr + 8); vl |= sla->suffix;