Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2324236imm; Mon, 28 May 2018 06:05:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoyf5At2FKoMDwctRddOBmZhvxOMQzXsYjGf9RbVk8KmAXyHOl4somQd073U1rcgpamOsl/ X-Received: by 2002:a62:859a:: with SMTP id m26-v6mr13339468pfk.247.1527512728880; Mon, 28 May 2018 06:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527512728; cv=none; d=google.com; s=arc-20160816; b=J50tTvxInFP4a5eZCykI1kR4wLORFbslPaEFhaUcjSUVXU9OKPB+Q5+VsIPkgkKn5d +x5+F+XiDhaaaMSPk2uu10C9zONDB7G4b4Nx9RIQsf1hGJfM6j22v4v9vY1+t7B1nKwz MK2GzDwd3hstZZp5pICLtFHJUHpuAomX93k4JA+eGMx08OWA3QZGZk9LOUfZOqPP2JXA duvZmfgXzCTYKrlY26V+/VadD5V0juYp1MEPDzz00T60QL2l0F1MJq5JKst6QALhvkZ6 pCkDfJwOjE/XPLzxXee49aI6HC7sztEe1pmEZv3Vujs5n8kOsMoPOWW1cpOXwKYXT/SW 52Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=zAnckP4CgwSkriXK2nRfBE1z+Dw9GxqK1iY8zbuFV4I=; b=GH082nd6R3Oafj3keM1IcoLZyJNjy2plHzTflrx07WrAPebRhClwHUocMw3m5hAJT5 GTaKXbykDrdHDKAwVN9uaH/Hqg7DSDjD1c7LreYRJAHCtvYCWM91jo6WRGdQQLiCl7xm q+sUjhMB4xgee+CT7DPpmmFmAf6ctQvEcXrpGG/dDVgp/QJRX2BIYQ90VyIlM5MssMht ik6WFr5GG8bf0cKLSEJ7JEwP3Z3yaXGUHSpF0DswrCvEs6nO2jf0PaXPHWo+5o1sPG8d jD5M5hBFrIkvFyHVbHacNCFHX8Kg7RuugFZKy7ThBAXHrZMDkeSSEXtn5b4OJmorm8zp /cQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OAF07nfC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8-v6si8374409pgu.6.2018.05.28.06.05.10; Mon, 28 May 2018 06:05:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OAF07nfC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164492AbeE1NDM (ORCPT + 99 others); Mon, 28 May 2018 09:03:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:42330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163509AbeE1KxG (ORCPT ); Mon, 28 May 2018 06:53:06 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 74475206B7; Mon, 28 May 2018 10:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504786; bh=7Yy0PBCbIwxWQ0SppHYeEOLt694xfnz/zVQlaedva7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OAF07nfClbs+NXozv6RyPJxxWtV0V1SqXxmRDI6zgcotENIaWbiAbdutmBOMZBu4W lTyYm1eb2rAK3fZXwecLKNEPpGYdi37DGo9X93mi7Gtg6GnOwN/Mjps8rIpMrcrUxN u3MAKnciL9t7fwPNVlo9Zu8Z1PQCMLVJ+pOkix7E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefano Brivio , Sabrina Dubroca , Steffen Klassert , Sasha Levin Subject: [PATCH 4.14 263/496] vti4: Dont count header length twice on tunnel setup Date: Mon, 28 May 2018 12:00:48 +0200 Message-Id: <20180528100330.948425698@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefano Brivio [ Upstream commit dd1df24737727e119c263acf1be2a92763938297 ] This re-introduces the effect of commit a32452366b72 ("vti4: Don't count header length twice.") which was accidentally reverted by merge commit f895f0cfbb77 ("Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec"). The commit message from Steffen Klassert said: We currently count the size of LL_MAX_HEADER and struct iphdr twice for vti4 devices, this leads to a wrong device mtu. The size of LL_MAX_HEADER and struct iphdr is already counted in ip_tunnel_bind_dev(), so don't do it again in vti_tunnel_init(). And this is still the case now: ip_tunnel_bind_dev() already accounts for the header length of the link layer (not necessarily LL_MAX_HEADER, if the output device is found), plus one IP header. For example, with a vti device on top of veth, with MTU of 1500, the existing implementation would set the initial vti MTU to 1332, accounting once for LL_MAX_HEADER (128, included in hard_header_len by vti) and twice for the same IP header (once from hard_header_len, once from ip_tunnel_bind_dev()). It should instead be 1480, because ip_tunnel_bind_dev() is able to figure out that the output device is veth, so no additional link layer header is attached, and will properly count one single IP header. The existing issue had the side effect of avoiding PMTUD for most xfrm policies, by arbitrarily lowering the initial MTU. However, the only way to get a consistent PMTU value is to let the xfrm PMTU discovery do its course, and commit d6af1a31cc72 ("vti: Add pmtu handling to vti_xmit.") now takes care of local delivery cases where the application ignores local socket notifications. Fixes: b9959fd3b0fa ("vti: switch to new ip tunnel code") Fixes: f895f0cfbb77 ("Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec") Signed-off-by: Stefano Brivio Acked-by: Sabrina Dubroca Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_vti.c | 1 - 1 file changed, 1 deletion(-) --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c @@ -396,7 +396,6 @@ static int vti_tunnel_init(struct net_de memcpy(dev->dev_addr, &iph->saddr, 4); memcpy(dev->broadcast, &iph->daddr, 4); - dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); dev->mtu = ETH_DATA_LEN; dev->flags = IFF_NOARP; dev->addr_len = 4;