]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
inet6: guard getting RA routers if inet6 not initialised
authorRoy Marples <roy@marples.name>
Sun, 9 Feb 2020 18:54:29 +0000 (18:54 +0000)
committerRoy Marples <roy@marples.name>
Sun, 9 Feb 2020 18:54:29 +0000 (18:54 +0000)
Now that we get inet6 routes even when only building inet routes
we need to guard as the RA routers collection could be NULL.

src/ipv6.c

index 18f32c6c729fe08c96557c6f64b7c929a79f0d44..0ac9f095f34083649da581d62fe542ad33e76380 100644 (file)
@@ -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;