]> git.baikalelectronics.ru Git - kernel.git/commit
net: Start with correct mac_len in skb_network_protocol
authorVlad Yasevich <vyasevic@redhat.com>
Mon, 14 Apr 2014 21:37:26 +0000 (17:37 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Apr 2014 22:58:58 +0000 (18:58 -0400)
commitd4259d326db633cd25debd2d7a8458920f76d5fc
treeadd7932efbb608a2137f9d3b8c0a7d96f950a77d
parent3b777ac4108d8cccacef6c88d84bd98effc48b8b
net: Start with correct mac_len in skb_network_protocol

Sometimes, when the packet arrives at skb_mac_gso_segment()
its skb->mac_len already accounts for some of the mac lenght
headers in the packet.  This seems to happen when forwarding
through and OpenSSL tunnel.

When we start looking for any vlan headers in skb_network_protocol()
we seem to ignore any of the already known mac headers and start
with an ETH_HLEN.  This results in an incorrect offset, dropped
TSO frames and general slowness of the connection.

We can start counting from the known skb->mac_len
and return at least that much if all mac level headers
are known and accounted for.

Fixes: 805a5b61b7323d9828978a8853bdf2c44076cda8 (net: Account for all vlan headers in skb_mac_gso_segment)
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: Daniel Borkman <dborkman@redhat.com>
Tested-by: Martin Filip <nexus+kernel@smoula.net>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c