summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-02-09 18:54:29 +0000
committerRoy Marples <roy@marples.name>2020-02-09 18:54:29 +0000
commitbbba9864563cc6fa1c43e02aee9634f83a47221c (patch)
tree2cb66b1070a65f6134b5bc8892d325b93dad984b /src/ipv6.c
parent670f0d8d727e8973e91a007ebf7843a5b84ea03b (diff)
downloaddhcpcd-bbba9864563cc6fa1c43e02aee9634f83a47221c.tar.xz
inet6: guard getting RA routers if inet6 not initialised
Now that we get inet6 routes even when only building inet routes we need to guard as the RA routers collection could be NULL.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index 18f32c6c..0ac9f095 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -2323,6 +2323,9 @@ inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
struct ra *rap;
const struct ipv6_addr *addr;
+ if (ctx->ra_routers == NULL)
+ return 0;
+
TAILQ_FOREACH(rap, ctx->ra_routers, next) {
if (rap->expired)
continue;