From 35d4acaf37ac5ed88b64760d1d558a6808ff54d0 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 1 May 2014 00:55:44 +0000 Subject: [PATCH] net: Start with correct mac_len in skb_network_protocol (Closes: #746453) svn path=/dists/sid/linux/; revision=21290 --- debian/changelog | 1 + ...orrect-mac_len-in-skb_network_protoc.patch | 40 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 42 insertions(+) create mode 100644 debian/patches/bugfix/all/net-Start-with-correct-mac_len-in-skb_network_protoc.patch diff --git a/debian/changelog b/debian/changelog index 2b1bbf335..a4d5f6680 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ linux (3.14.2-2) UNRELEASED; urgency=medium [ Ben Hutchings ] * [or1k] Build a linux-libc-dev package (Closes: #746309) + * net: Start with correct mac_len in skb_network_protocol (Closes: #746453) -- Ben Hutchings Thu, 01 May 2014 01:50:30 +0100 diff --git a/debian/patches/bugfix/all/net-Start-with-correct-mac_len-in-skb_network_protoc.patch b/debian/patches/bugfix/all/net-Start-with-correct-mac_len-in-skb_network_protoc.patch new file mode 100644 index 000000000..7e59d291c --- /dev/null +++ b/debian/patches/bugfix/all/net-Start-with-correct-mac_len-in-skb_network_protoc.patch @@ -0,0 +1,40 @@ +From: Vlad Yasevich +Date: Mon, 14 Apr 2014 17:37:26 -0400 +Subject: net: Start with correct mac_len in skb_network_protocol +Origin: https://git.kernel.org/linus/1e785f48d29a09b6cf96db7b49b6320dada332e1 + +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 +CC: Daniel Borkman +Tested-by: Martin Filip +Signed-off-by: Vlad Yasevich +Signed-off-by: David S. Miller +--- + net/core/dev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -2289,7 +2289,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)) { diff --git a/debian/patches/series b/debian/patches/series index a9fd4f4ca..72797ea82 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -82,3 +82,4 @@ features/arm/0003-spi-sun6i-Set-bits_per_word_mask-to-only-support-8-b.patch features/arm/ARM-dt-sun4i-Add-A10-SPI-controller-nodes.patch features/arm/PHY-sunxi-Add-driver-for-sunxi-usb-phy.patch features/arm/ARM-sun4i-dt-Add-USB-host-bindings.patch +bugfix/all/net-Start-with-correct-mac_len-in-skb_network_protoc.patch