]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If we can turn off IPv6 auto link-addr in the kernel, lets do so
authorRoy Marples <roy@marples.name>
Thu, 5 Jun 2014 12:33:18 +0000 (12:33 +0000)
committerRoy Marples <roy@marples.name>
Thu, 5 Jun 2014 12:33:18 +0000 (12:33 +0000)
to ensure we have the best chance of generating our private link-addr.

if-bsd.c

index 517864816702a173e3d0b9ba06ab4295420388b6..9a6e4864f67c66cb8256b8990dc0081113ee0c9b 100644 (file)
--- 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)