From: Roy Marples Date: Mon, 14 Oct 2019 15:01:00 +0000 (+0100) Subject: inet6: Fix a potential crash learning addresses X-Git-Tag: v8.1.1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8419bbd5b6e3709854d2cff977729f28ed84bf4a;p=thirdparty%2Fdhcpcd.git inet6: Fix a potential crash learning addresses Interface maybe active but without options. In this case, check the global state of IPv6. --- diff --git a/src/ipv6.c b/src/ipv6.c index 99f6a8a4..8a77a401 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -1253,7 +1253,9 @@ out: * or DHCP6 handlers and the existance of any useable * global address on the interface has changed, * call rt_build to add/remove the default route. */ - if (ifp->active && ifp->options->options & DHCPCD_IPV6 && + if (ifp->active && + ((ifp->options != NULL && ifp->options->options & DHCPCD_IPV6) || + (ifp->options == NULL && ctx->options & DHCPCD_IPV6)) && !(ctx->options & DHCPCD_RTBUILD) && (ipv6_anyglobal(ifp) != NULL) != anyglobal) rt_build(ctx, AF_INET6);