net: Start with correct mac_len in skb_network_protocol
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: 53d6471cef17262d3ad1c7ce8982a234244f68ec (net: Account for all vlan headers in skb_mac_gso_segment)
CC: Eric Dumazet <a0baddf32b28d2f9429941ed4af2fe636e210591@gmail.com>
CC: Daniel Borkman <9ff04a02a69f376b2b9aeec27187017cbf3cf5f9@redhat.com>
Tested-by: Martin Filip <1fa0bf9faf571b19bba8b105ab1632ff009f79d0@smoula.net>
Signed-off-by: Vlad Yasevich <cbd80080413a7dff621bc5de2d3d61903bde20a2@redhat.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs