disable private IPv6 addresses, re-enable default-route
authorHenri Manson <hfmanson@gmail.com>
Fri, 7 Jul 2017 07:03:11 +0000 (09:03 +0200)
committerHenri Manson <hfmanson@gmail.com>
Fri, 7 Jul 2017 07:03:11 +0000 (09:03 +0200)
peer.c

diff --git a/peer.c b/peer.c
index 6affab4..10759a1 100644 (file)
--- a/peer.c
+++ b/peer.c
@@ -328,6 +328,10 @@ bool setup_tunnel_address (void) {
 syslog (LOG_CRIT, "Bad news!\n");
                ok = false;
        }
+       snprintf (cmd, 512, "/sbin/sysctl -w net.ipv6.conf.%s.use_tempaddr=-1", ifreq.ifr_name);
+       if (ok && system (cmd) != 0) {
+               ok = 0;
+       }
        snprintf (cmd, 512, "/sbin/ip link set %s up mtu %d", ifreq.ifr_name, MTU);
        if (ok && system (cmd) != 0) {
                ok = false;
@@ -344,7 +348,7 @@ syslog (LOG_CRIT, "Bad news!\n");
                ok = false;
        }
 #endif
-#if 0
+#if 1
        if (default_route) {
                snprintf (cmd, 512, "/sbin/ip -6 route add default via fe80:: dev %s", ifreq.ifr_name);
                if (ok && system (cmd) != 0) {