Require OpenSSL 1.1.0 or later.
[tinc] / src / route.c
index 3e86b40..f8b11bb 100644 (file)
@@ -581,7 +581,7 @@ static void fragment_ipv4_packet(node_t *dest, vpn_packet_t *packet, length_t et
        ifdebug(TRAFFIC) logger(LOG_INFO, "Fragmenting packet of %d bytes to %s (%s)", packet->len, dest->name, dest->hostname);
 
        offset = packet->data + ether_size + ip_size;
-       maxlen = (dest->mtu - ether_size - ip_size) & ~0x7;
+       maxlen = (MAX(dest->mtu, 590) - ether_size - ip_size) & ~0x7;
        ip_off = ntohs(ip.ip_off);
        origf = ip_off & ~IP_OFFMASK;
        ip_off &= IP_OFFMASK;
@@ -882,7 +882,7 @@ static void route_neighborsol(node_t *source, vpn_packet_t *packet) {
        memcpy(packet->data, packet->data + ETH_ALEN, ETH_ALEN);        /* copy destination address */
        packet->data[ETH_ALEN * 2 - 1] ^= 0xFF; /* mangle source address so it looks like it's not from us */
 
-       ip6.ip6_dst = ip6.ip6_src;                      /* swap destination and source protocoll address */
+       ip6.ip6_dst = ip6.ip6_src;                      /* swap destination and source protocol address */
        ip6.ip6_src = ns.nd_ns_target;
 
        if(has_opt) {