diff options
author | Cong Wang <amwang@redhat.com> | 2013-02-21 23:32:27 +0000 |
---|---|---|
committer | Xavier Boudet <x-boudet@ti.com> | 2013-03-01 10:53:11 +0100 |
commit | f7cca8b8b156121c1229c2e2e4bdea7b0ab73b1c (patch) | |
tree | c61cd9aec3c219f2724b49dbd22046edfff35744 /fs/freevxfs/vxfs_super.c | |
parent | c2d2ab40d760c5978e747597a70bc0934fe1736e (diff) |
vlan: adjust vlan_set_encap_proto() for its callers
[ Upstream commit da8c87241c26aac81a64c7e4d21d438a33018f4e ]
There are two places to call vlan_set_encap_proto():
vlan_untag() and __pop_vlan_tci().
vlan_untag() assumes skb->data points after mac addr, otherwise
the following code
vhdr = (struct vlan_hdr *) skb->data;
vlan_tci = ntohs(vhdr->h_vlan_TCI);
__vlan_hwaccel_put_tag(skb, vlan_tci);
skb_pull_rcsum(skb, VLAN_HLEN);
won't be correct. But __pop_vlan_tci() assumes points _before_
mac addr.
In vlan_set_encap_proto(), it looks for some magic L2 value
after mac addr:
rawp = skb->data;
if (*(unsigned short *) rawp == 0xFFFF)
...
Therefore __pop_vlan_tci() is obviously wrong.
A quick fix is avoiding using skb->data in vlan_set_encap_proto(),
use 'vhdr+1' is always correct in both cases.
Signed-off-by: Cong Wang <amwang@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jesse Gross <jesse@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/freevxfs/vxfs_super.c')
0 files changed, 0 insertions, 0 deletions