Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't configure an IPv6 link-local address if noipv6rs is set #380

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/if-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion src/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading