vlan: fix network_header/mac_header adjustments
Lennert Buytenhek points out that the VLAN code incorrectly adjusts
skb->network_header to point in the middle of the VLAN header and
additionally tries to adjust skb->mac_header without checking for
validity.
The network_header should not be touched at all since we're only
adding headers in front of it, mac_header adjustments are not
necessary at all.
Based on patch by Lennert Buytenhek <buytenh@wantstofly.org>.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 5190452..8f5bf9b 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -279,8 +279,6 @@
veth->h_vlan_TCI = htons(tag);
skb->protocol = htons(ETH_P_8021Q);
- skb->mac_header -= VLAN_HLEN;
- skb->network_header -= VLAN_HLEN;
return skb;
}
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index a0617bf..4a85259 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -308,7 +308,6 @@
vhdr->h_vlan_encapsulated_proto = htons(len);
skb->protocol = htons(ETH_P_8021Q);
- skb_reset_network_header(skb);
}
/* Before delegating work to the lower layer, enter our MAC-address */