summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
diff options
context:
space:
mode:
authorCong Wang <amwang@redhat.com>2013-02-22 03:32:27 +0400
committerDavid S. Miller <davem@davemloft.net>2013-02-24 06:00:06 +0400
commitda8c87241c26aac81a64c7e4d21d438a33018f4e (patch)
treeff2224eaeac133a20ce0ab7f128d386a8216c4b3 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
parent8e904550d0fffcda2b18d7ab12750b0c75757e89 (diff)
downloadlinux-da8c87241c26aac81a64c7e4d21d438a33018f4e.tar.xz
vlan: adjust vlan_set_encap_proto() for its callers
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. Cc: David S. Miller <davem@davemloft.net> Cc: Jesse Gross <jesse@nicira.com> Signed-off-by: Cong Wang <amwang@redhat.com> Acked-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c')
0 files changed, 0 insertions, 0 deletions