summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2019-10-14 16:01:00 +0100
committerRoy Marples <roy@marples.name>2019-10-14 16:01:00 +0100
commit8419bbd5b6e3709854d2cff977729f28ed84bf4a (patch)
tree0d299e256b8265672a6256396926efc3c7a0ed1e /src/ipv6.c
parentca87fad681e3822933b3facc7d5c10138b05e35d (diff)
downloaddhcpcd-8419bbd5b6e3709854d2cff977729f28ed84bf4a.tar.xz
inet6: Fix a potential crash learning addresses
Interface maybe active but without options. In this case, check the global state of IPv6.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c4
1 files changed, 3 insertions, 1 deletions
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);