Stopped setting LLADDR for 6bed4. Copied all of prefix (also the 2 bits)
authorRick van Rein <rick@openfortress.nl>
Sun, 17 Sep 2017 12:41:41 +0000 (13:41 +0100)
committerRick van Rein <rick@openfortress.nl>
Sun, 17 Sep 2017 12:41:41 +0000 (13:41 +0100)
6bed4peer.c
6bed4router.c

index 03e8b72..c049fc4 100644 (file)
@@ -324,11 +324,13 @@ bool setup_tunnel_address (void) {
        if (ok && system (cmd) != 0) {
                ok = 0;
        }
+#ifdef TODO_NO_LLADDR_FOR_NOW
        snprintf (cmd, 512, "/sbin/ip link set %s address %02x:%02x:%02x:%02x:%02x:%02x", ifreq.ifr_name, v6lladdr [0], v6lladdr [1], v6lladdr [2], v6lladdr [3], v6lladdr [4], v6lladdr [5]);
        if (ok && system (cmd) != 0) {
 syslog (LOG_CRIT, "Bad news!\n");
                ok = false;
        }
+#endif
        snprintf (cmd, 512, "/sbin/ip link set %s up mtu %d", ifreq.ifr_name, MTU);
        if (ok && system (cmd) != 0) {
                ok = false;
@@ -892,7 +894,7 @@ void handle_4to6_nd (struct sockaddr_in *sin, ssize_t v4ngbcmdlen) {
                        rdofs += (v4v6icmpdata [rdofs + 1] << 3);
                }
                if (destprefix) {
-                       memcpy (v6listen.s6_addr + 0, destprefix, 14);
+                       memcpy (v6listen.s6_addr + 0, destprefix, 16);
                        v6listen.s6_addr [14] &= 0xc0;
                        v6listen.s6_addr [15]  = 0x01;  // choose client 1
                        memcpy (v6listen_linklocal_complete+0,
index 59017c0..7de998b 100644 (file)
@@ -215,6 +215,7 @@ int setup_tunnel (void) {
        }
        if (!ok) {
                close (v6sox);  /* This removes the tunnel interface */
+               fprintf (stderr, "Failed to setup tunnel \"%s\"\n", INTERFACE_NAME_6BED4);
        }
        return ok;
 }