Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2180077imm; Mon, 28 May 2018 03:22:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrjMKOnwYZSiK7r5TALKmCrZUGeGuNXHFG5rprUSJRsww2XCjClzoUQph3sb98mEKUidNYl X-Received: by 2002:a17:902:3081:: with SMTP id v1-v6mr13364123plb.266.1527502926964; Mon, 28 May 2018 03:22:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527502926; cv=none; d=google.com; s=arc-20160816; b=pKoTKmvQXTXkpWnTO2bTmOipRuKqQrOXotIEtuGb2kZi6E2N4klYAe9K7NgyvXL9zJ /kFN5mleG0YO9pcD9ECpCJdc+zPsJbet6QQj6VNAd4WXs7lOTGvMIepLS5crNRPu3vHa 3RK7w2uhIOTl/d4unhJdG01W97P1DDSgr+ORDKPBL8egpSJzCGeCYwGIYhHEgYIcZWix Cj+AotbevPUcaQbCaN/vhfCfEqOwV39mejvK1afhAzQCH2iovVbtxMkhhPhT3oqUQ3/Q DSDiwPmogZa/xXlx6Of7Jq4VbBSnsaNlMxODpQwWyHvnnSPGlJz2gQoNi/eBkJeTRIaJ lsuQ== 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=TsXOz41c/aI40mFxm1J8EBwoZg2Zyh2OwjhRtempiA8=; b=Zefx7d1SNpzFLm0i1fWaosOOW+UZvBK429YsMjv4VnreESEF4FS79pj1BwWGQCKs4S TcNUlueDf8xXVq/xolND9NbxXdD3nZf9SNj1RS8F3/aNydIlBHHA9zjEbfLFNbrenTZD XPQmnsZrZOSWXltif4zmeZPLslyU0iIhHKwdbfAV8hf9hf+bWIn9EjFcPSFRB4VSixbo SGb1lzJHZWglisHzZeHLrGzvUXcjd5BMs0rIziwgjFhVfGT9RVBsTfmRl2YLD5btaZKQ 85vdnlcAb5jvtqb0vdgXPJXP/4nn6SYwp5iI3iPPnjvWlHY+JQvbyhW07U2DEH+4hSfj +SgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hG5E+0p/; 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 j84-v6si30049105pfk.203.2018.05.28.03.21.52; Mon, 28 May 2018 03:22:06 -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=hG5E+0p/; 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 S1032303AbeE1KUe (ORCPT + 99 others); Mon, 28 May 2018 06:20:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:40096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033165AbeE1KUZ (ORCPT ); Mon, 28 May 2018 06:20:25 -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 6769220843; Mon, 28 May 2018 10:20:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502824; bh=9yM5hxD+0pvzunBX6Pqg4i42IeuAAlV9U4Sms8stKjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hG5E+0p/VUtfO+076T/a5T6VmoVLNQMGWRgs+h3S7757A3KJz57uRN1BGh4CE7vmn dvu4Yw7nJ7B2sbY4ByiBK8dOY/+PRTw1IH+Ezf5oiMdLNBjLqh8FVAf84kr29lC06W HNQFQnreFfugR+p25wRpnHVhAtzbliAFd2bULhVw= 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.4 140/268] vti4: Dont count header length twice on tunnel setup Date: Mon, 28 May 2018 12:01:54 +0200 Message-Id: <20180528100218.209017020@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@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.4-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 @@ -366,7 +366,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;