Skip to content

Commit 7e9f3fd

Browse files
Jon FranklinJon Franklin
Jon Franklin
authored and
Jon Franklin
committed
Don't configure an IPv6 link-local address if noipv6rs is set
1 parent 58230c2 commit 7e9f3fd

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/if-linux.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,6 +2173,11 @@ if_setup_inet6(const struct interface *ifp)
21732173
int ra;
21742174
char path[256];
21752175

2176+
/* If not doing autoconf, don't disable the kernel from doing it.
2177+
* If we need to, we should have another option actively disable it. */
2178+
if (!(ifp->options->options & DHCPCD_IPV6RS))
2179+
return;
2180+
21762181
/* Modern linux kernels can make a stable private address.
21772182
* However, a lot of distros ship newer kernel headers than
21782183
* the kernel itself so we sweep that error under the table
@@ -2181,11 +2186,6 @@ if_setup_inet6(const struct interface *ifp)
21812186
errno != ENODEV && errno != ENOTSUP && errno != EINVAL)
21822187
logdebug("%s: if_disable_autolinklocal", ifp->name);
21832188

2184-
/* If not doing autoconf, don't disable the kernel from doing it.
2185-
* If we need to, we should have another option actively disable it. */
2186-
if (!(ifp->options->options & DHCPCD_IPV6RS))
2187-
return;
2188-
21892189
snprintf(path, sizeof(path), "%s/%s/autoconf", p_conf, ifp->name);
21902190
ra = check_proc_int(ctx, path);
21912191
if (ra == -1) {

src/ipv6.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,8 @@ ipv6_addlinklocal(struct interface *ifp)
14281428
struct ipv6_addr *ap, *ap2;
14291429
int dadcounter;
14301430

1431-
if (!(ifp->options->options & DHCPCD_CONFIGURE))
1431+
if (!(ifp->options->options & DHCPCD_CONFIGURE) ||
1432+
!(ifp->options->options & DHCPCD_IPV6RS))
14321433
return 0;
14331434

14341435
/* Check sanity before malloc */

0 commit comments

Comments
 (0)