]> git.baikalelectronics.ru Git - kernel.git/commit
net: Account for all vlan headers in skb_mac_gso_segment
authorVlad Yasevich <vyasevic@redhat.com>
Thu, 27 Mar 2014 21:26:18 +0000 (17:26 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Mar 2014 21:10:36 +0000 (17:10 -0400)
commit805a5b61b7323d9828978a8853bdf2c44076cda8
treeb7adb468b9fb7b500a96222742a3752545ff47b6
parentbca052e175ca81bb5b508cf2944a880a12c464dd
net: Account for all vlan headers in skb_mac_gso_segment

skb_network_protocol() already accounts for multiple vlan
headers that may be present in the skb.  However, skb_mac_gso_segment()
doesn't know anything about it and assumes that skb->mac_len
is set correctly to skip all mac headers.  That may not
always be the case.  If we are simply forwarding the packet (via
bridge or macvtap), all vlan headers may not be accounted for.

A simple solution is to allow skb_network_protocol to return
the vlan depth it has calculated.  This way skb_mac_gso_segment
will correctly skip all mac headers.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/dev.c
net/core/skbuff.c