projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2a3e343
)
Make sure PriorityInheritance also works in switch mode.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 20 Jan 2013 14:16:13 +0000
(15:16 +0100)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 20 Jan 2013 14:16:13 +0000
(15:16 +0100)
src/route.c
patch
|
blob
|
history
diff --git
a/src/route.c
b/src/route.c
index 13f81572c66d504809d3e15282341225823c944f..4ae56a5348849096911ffa6a11e475ec3da031fd 100644
(file)
--- a/
src/route.c
+++ b/
src/route.c
@@
-836,6
+836,11
@@
static void route_mac(node_t *source, vpn_packet_t *packet) {
if(forwarding_mode == FMODE_OFF && source != myself && subnet->owner != myself)
return;
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;
// Handle packets larger than PMTU
node_t *via = (subnet->owner->via == myself) ? subnet->owner->nexthop : subnet->owner->via;
@@
-845,7
+850,6
@@
static void route_mac(node_t *source, vpn_packet_t *packet) {
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(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);
- uint16_t type = packet->data[12] << 8 | packet->data[13];
length_t ethlen = 14;
if(type == ETH_P_8021Q) {
length_t ethlen = 14;
if(type == ETH_P_8021Q) {