summaryrefslogtreecommitdiffstats
path: root/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-06-05 12:33:18 +0000
committerRoy Marples <roy@marples.name>2014-06-05 12:33:18 +0000
commit457dd83a486108e52d74875f80f0154e2a3c98de (patch)
tree27c35c5bec31394e97cd7024647da6d892eb57a0 /if-bsd.c
parent2612c7f005dc37b16a4645a4bf61a4631509ae56 (diff)
downloaddhcpcd-457dd83a486108e52d74875f80f0154e2a3c98de.tar.xz
If we can turn off IPv6 auto link-addr in the kernel, lets do so
to ensure we have the best chance of generating our private link-addr.
Diffstat (limited to 'if-bsd.c')
-rw-r--r--if-bsd.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/if-bsd.c b/if-bsd.c
index 51786481..9a6e4864 100644
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -1108,6 +1108,34 @@ if_checkipv6(struct dhcpcd_ctx *ctx, const char *ifname, int own)
}
#endif
+#ifdef ND6_IFF_AUTO_LINKLOCAL
+ if (own) {
+ int all;
+
+ all = get_if_nd6_flag(ifname, ND6_IFF_AUTO_LINKLOCAL);
+ if (all == -1)
+ syslog(LOG_ERR,
+ "%s: get_if_nd6_flag: "
+ "ND6_IFF_AUTO_LINKLOCAL: %m",
+ ifname);
+ else if (all != 0) {
+ syslog(LOG_DEBUG,
+ "%s: disabling Kernel IPv6 "
+ "auto link-local support",
+ ifname);
+ if (del_if_nd6_flag(ifname,
+ ND6_IFF_AUTO_LINKLOCAL) == -1)
+ {
+ syslog(LOG_ERR,
+ "%s: del_if_nd6_flag: "
+ "ND6_IFF_AUTO_LINKLOCAL: %m",
+ ifname);
+ return -1;
+ }
+ }
+ }
+#endif
+
#ifdef ND6_IFF_OVERRIDE_RTADV
override = get_if_nd6_flag(ifname, ND6_IFF_OVERRIDE_RTADV);
if (override == -1)