diff --git a/src/if-linux.c b/src/if-linux.c index 53fa48f5..446b5315 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -2196,6 +2196,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 @@ -2204,11 +2209,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 c746f775..9c39599e 100644 --- a/src/ipv6.c +++ b/src/ipv6.c @@ -1418,7 +1418,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 */