aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-07-08 06:21:27 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-08 06:21:27 -0400
commitacc81e1465d29e0284008770cc4b8bc90bd93bd7 (patch)
tree7580b619f82a6ae13c425051c305b7d5501e201d
parent256f3bfce87fe39ec008b2c27890b30066984f50 (diff)
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>
-rw-r--r--include/linux/if_vlan.h2
-rw-r--r--net/8021q/vlan_dev.c1
2 files changed, 0 insertions, 3 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 5190452ac7dc..8f5bf9b676aa 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -279,8 +279,6 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short
279 veth->h_vlan_TCI = htons(tag); 279 veth->h_vlan_TCI = htons(tag);
280 280
281 skb->protocol = htons(ETH_P_8021Q); 281 skb->protocol = htons(ETH_P_8021Q);
282 skb->mac_header -= VLAN_HLEN;
283 skb->network_header -= VLAN_HLEN;
284 282
285 return skb; 283 return skb;
286} 284}
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index a0617bf7cec6..4a8525927c27 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -308,7 +308,6 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
308 vhdr->h_vlan_encapsulated_proto = htons(len); 308 vhdr->h_vlan_encapsulated_proto = htons(len);
309 309
310 skb->protocol = htons(ETH_P_8021Q); 310 skb->protocol = htons(ETH_P_8021Q);
311 skb_reset_network_header(skb);
312 } 311 }
313 312
314 /* Before delegating work to the lower layer, enter our MAC-address */ 313 /* Before delegating work to the lower layer, enter our MAC-address */