]> Git Repo - linux.git/commitdiff
net: Start with correct mac_len in skb_network_protocol
authorVlad Yasevich <[email protected]>
Mon, 14 Apr 2014 21:37:26 +0000 (17:37 -0400)
committerDavid S. Miller <[email protected]>
Mon, 14 Apr 2014 22:58:58 +0000 (18:58 -0400)
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 <[email protected]>
CC: Daniel Borkman <[email protected]>
Tested-by: Martin Filip <[email protected]>
Signed-off-by: Vlad Yasevich <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/core/dev.c

index 14dac0654f28c273d8ebd7df001adb9d86934443..5b3042e69f85646961a910977e041fc16a94cc78 100644 (file)
@@ -2284,7 +2284,7 @@ EXPORT_SYMBOL(skb_checksum_help);
 __be16 skb_network_protocol(struct sk_buff *skb, int *depth)
 {
        __be16 type = skb->protocol;
-       int vlan_depth = ETH_HLEN;
+       int vlan_depth = skb->mac_len;
 
        /* Tunnel gso handlers can set protocol to ethernet. */
        if (type == htons(ETH_P_TEB)) {
This page took 0.092832 seconds and 4 git commands to generate.