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
commitd1888651139a4a8a115ba2c7859d1aaa38fcaa76 (patch)
tree2cb66b1070a65f6134b5bc8892d325b93dad984b /src/ipv6.c
parentce59a41e77320a79dd6e2f858103fc18d52f2399 (diff)
downloaddhcpcd-d1888651139a4a8a115ba2c7859d1aaa38fcaa76.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;