diff --git a/src/if-linux.c b/src/if-linux.c index 7e0e3c72..20fb69de 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -2264,6 +2264,11 @@ if_setup_inet6(const struct interface *ifp) int ra; char path[256]; + /* If not doing autoconf, don't disable the kernel from doing it. + * If we need to, we should have another option actively disable it. */ + if (!(ifp->options->options & DHCPCD_IPV6RS)) + return; + /* Modern linux kernels can make a stable private address. * However, a lot of distros ship newer kernel headers than * the kernel itself so we sweep that error under the table @@ -2272,11 +2277,6 @@ if_setup_inet6(const struct interface *ifp) errno != ENODEV && errno != ENOTSUP && errno != EINVAL) logdebug("%s: if_disable_autolinklocal", ifp->name); - /* If not doing autoconf, don't disable the kernel from doing it. - * If we need to, we should have another option actively disable it. */ - if (!(ifp->options->options & DHCPCD_IPV6RS)) - return; - snprintf(path, sizeof(path), "%s/%s/autoconf", p_conf, ifp->name); ra = check_proc_int(ctx, path); if (ra == -1) { diff --git a/src/ipv6.c b/src/ipv6.c index 30f37652..953421e8 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -1424,7 +1424,8 @@ ipv6_addlinklocal(struct interface *ifp) struct ipv6_addr *ap, *ap2; int dadcounter; - if (!(ifp->options->options & DHCPCD_CONFIGURE)) + if (!(ifp->options->options & DHCPCD_CONFIGURE) || + !(ifp->options->options & DHCPCD_IPV6RS)) return 0; /* Check sanity before malloc */