X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Froute.c;h=1d0c6f8a40efc15560bdade6fec92450ddbb35b4;hp=7bb9996179e6de082fbb736deb2864ff4eb91b65;hb=1be7dc759a64d436fd7586aad43b545f2dc665b5;hpb=94587264bda45cce0295aaa37b59905d4b9843a8 diff --git a/src/route.c b/src/route.c index 7bb99961..1d0c6f8a 100644 --- a/src/route.c +++ b/src/route.c @@ -835,6 +835,11 @@ static void route_mac(node_t *source, vpn_packet_t *packet) { if(forwarding_mode == FMODE_OFF && source != myself && subnet->owner != myself) return; + uint16_t type = packet->data[12] << 8 | packet->data[13]; + + if(priorityinheritance && type == ETH_P_IP && packet->len >= ether_size + ip_size) + packet->priority = packet->data[15]; + // Handle packets larger than PMTU node_t *via = (subnet->owner->via == myself) ? subnet->owner->nexthop : subnet->owner->via; @@ -844,7 +849,6 @@ static void route_mac(node_t *source, vpn_packet_t *packet) { if(via && packet->len > via->mtu && via != myself) { logger(DEBUG_TRAFFIC, LOG_INFO, "Packet for %s (%s) length %d larger than MTU %d", subnet->owner->name, subnet->owner->hostname, packet->len, via->mtu); - uint16_t type = packet->data[12] << 8 | packet->data[13]; length_t ethlen = 14; if(type == ETH_P_8021Q) {