+ via = (subnet->owner->via == myself) ? subnet->owner->nexthop : subnet->owner->via;
+
+ if(via && packet->len > via->mtu && via != myself) {
+ ifdebug(TRAFFIC) logger(LOG_INFO, _("Packet for %s (%s) length %d larger than MTU %d"), subnet->owner->name, subnet->owner->hostname, packet->len, via->mtu);
+ if(packet->data[20] & 0x40) {
+ packet->len = via->mtu;
+ route_ipv4_unreachable(source, packet, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED);
+ } else {
+ fragment_ipv4_packet(via, packet);
+ }
+
+ return;
+ }
+
+ send_packet(subnet->owner, packet);
+}
+
+static void route_ipv4(node_t *source, vpn_packet_t *packet)
+{
+ cp();
+
+ if(!checklength(source, packet, ether_size + ip_size))
+ return;
+
+ if(((packet->data[30] & 0xf0) == 0xe0) || (
+ packet->data[30] == 255 &&
+ packet->data[31] == 255 &&
+ packet->data[32] == 255 &&
+ packet->data[33] == 255))
+ broadcast_packet(source, packet);
+ else
+ route_ipv4_unicast(source, packet);