From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619AbdBETmg (ORCPT + 2 others); Sun, 5 Feb 2017 14:42:36 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:28370 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753887AbdBET1P (ORCPT ); Sun, 5 Feb 2017 14:27:15 -0500 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux@roeck-us.net Cc: Eli Cooper , "David S . Miller" , Willy Tarreau Subject: [PATCH 3.10 270/319] ipv4: Set skb->protocol properly for local output Date: Sun, 5 Feb 2017 20:21:32 +0100 Message-Id: <1486322541-8206-171-git-send-email-w@1wt.eu> X-Mailer: git-send-email 2.8.0.rc2.1.gbe9624a In-Reply-To: <1486322541-8206-1-git-send-email-w@1wt.eu> References: <1486322541-8206-1-git-send-email-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Eli Cooper commit f4180439109aa720774baafdd798b3234ab1a0d2 upstream. When xfrm is applied to TSO/GSO packets, it follows this path: xfrm_output() -> xfrm_output_gso() -> skb_gso_segment() where skb_gso_segment() relies on skb->protocol to function properly. This patch sets skb->protocol to ETH_P_IP before dst_output() is called, fixing a bug where GSO packets sent through a sit tunnel are dropped when xfrm is involved. Signed-off-by: Eli Cooper Signed-off-by: David S. Miller Signed-off-by: Willy Tarreau --- net/ipv4/ip_output.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 57e7450..5f077ef 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -97,6 +97,9 @@ int __ip_local_out(struct sk_buff *skb) iph->tot_len = htons(skb->len); ip_send_check(iph); + + skb->protocol = htons(ETH_P_IP); + return nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT, skb, NULL, skb_dst(skb)->dev, dst_output); } -- 2.8.0.rc2.1.gbe9624a