diff --git a/src/net_packet.c b/src/net_packet.c index 2be599eb..aca84683 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -355,9 +355,9 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) return; } - if(n->options & OPTION_PMTU_DISCOVERY && !n->minmtu && (inpkt->data[12] | inpkt->data[13])) { + if(n->options & OPTION_PMTU_DISCOVERY && inpkt->len > n->minmtu && (inpkt->data[12] | inpkt->data[13])) { ifdebug(TRAFFIC) logger(LOG_INFO, - _("No minimum MTU established yet for %s (%s), forwarding via TCP"), + _("Packet for %s (%s) larger than minimum MTU, forwarding via TCP"), n->name, n->hostname); send_tcppacket(n->nexthop->connection, origpkt); diff --git a/src/route.c b/src/route.c index d748db16..9b689039 100644 --- a/src/route.c +++ b/src/route.c @@ -769,13 +769,12 @@ static void route_mac(node_t *source, vpn_packet_t *packet) } else { fragment_ipv4_packet(via, packet); } + return; } else if(type == ETH_P_IPV6) { packet->len = via->mtu; route_ipv6_unreachable(source, packet, ICMP6_PACKET_TOO_BIG, 0); - } else - ifdebug(TRAFFIC) logger(LOG_INFO, _("Large packet of unhandled type %hx dropped"), type); - - return; + return; + } } send_packet(subnet->owner, packet);