Skip to content

Commit

Permalink
vlan: fix network_header/mac_header adjustments
Browse files Browse the repository at this point in the history
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 <[email protected]>.

Signed-off-by: Patrick McHardy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
kaber authored and davem330 committed Jul 8, 2008
1 parent 256f3bf commit acc81e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions include/linux/if_vlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short
veth->h_vlan_TCI = htons(tag);

skb->protocol = htons(ETH_P_8021Q);
skb->mac_header -= VLAN_HLEN;
skb->network_header -= VLAN_HLEN;

return skb;
}
Expand Down
1 change: 0 additions & 1 deletion net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
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 */
Expand Down

0 comments on commit acc81e1

Please sign in to comment.