• Vlad Yasevich's avatar
    net: Start with correct mac_len in skb_network_protocol · 1e785f48
    Vlad Yasevich authored
    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: 53d6471c (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: default avatarMartin Filip <nexus+kernel@smoula.net>
    Signed-off-by: default avatarVlad Yasevich <vyasevic@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1e785f48
dev.c 176 KB