Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2516007imm; Mon, 28 May 2018 09:33:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpZ488eGO6wF57v0lcsSdIPK/h0ZiBJ43hAmMdSg+YzpkCwRRjiWpLjLIzNdugh3Zt6aiTW X-Received: by 2002:a63:7f51:: with SMTP id p17-v6mr11106016pgn.36.1527525189043; Mon, 28 May 2018 09:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527525189; cv=none; d=google.com; s=arc-20160816; b=awDGDIHlez4nyszgkjZoUpOlUF6k+XO87MdM2DgsJ7Tm7n4/PdZp75f7Vf4U254joy AuITPJRWEkMyNm1tIJ3U8vmNuCNnUVHGT2DBaF6yPImZrGnFaBAiq8L+1VpbIbRhSr9E 8XpFDVH5ClsbYlqSytdWy7HIrglBmDohFVV5hUdaLqnYduTDLDZyHM3io7Ptq9TRBRlD DGW6SCZ0EKAQuWANc7jteVIqC5Ij1yF88lbfGFyvBNzSSq3tJkDTbGpqZEEpFUT9WI7H G2CYdifZ0IPLPi5dEqn0tih7KrwztqYE97yju1dPs2Jic3WRokbAC9NaG6qcLtR0fFl7 XKIg== 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=WoMsvJnvShSU/UJ/fliMHc9ypaVFG9uV8fwOf2WZNNA=; b=sIa8YSKvPopPenlXbka6U+WosOOf2A6Bq84ueF1rBYfy3qJ+BamfhPoq/ntJRYkRoH j0oflMgeX0+egjCSqa87kXkqhIqeG/jsJMxsJotZlZGOv3cXWdVnbsUXsNxlEPHjRaKU gGuSkAkDbIu0f3Lau5UkumhzkDziMWwPCJ+vZgISHvaOcPn06bbHv6tWBEE7DLf2+l50 hhSZQsRZ40nS39l4uTGMQAeTUxUCREjJhxAvMt6BmamhJ69u/MaHN4je3RnE3YeskpID cWYCTZteIyokI/YDSi9gcI1zB8GXFwUlG4cXy7ccHwdU1rEPX5sLxbRn/1/CqNG676VG jHwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hY5UQDHa; 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 r63-v6si29731993plb.366.2018.05.28.09.32.54; Mon, 28 May 2018 09:33:09 -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=hY5UQDHa; 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 S935285AbeE1KJQ (ORCPT + 99 others); Mon, 28 May 2018 06:09:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:57244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934596AbeE1KJI (ORCPT ); Mon, 28 May 2018 06:09:08 -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 6B4E82086D; Mon, 28 May 2018 10:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502147; bh=01ipaOzz1WJ4YfivP7R8OAOLWz9PAm1ayVOr1PJpVkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hY5UQDHaMkid7Ercw8rah6iBzb8DEYqwhkDhDRNjpMCh2PmUmgCwjN2D27j3FTVdk wC+uXlOCpGZtBnm4JpC4ZPBTA1mib9dSN7B/SUkbE+3Tq9BrGxe72q0j1+TihbBTrk QfBDj8M35iV+VEbngWUUWl2pSGoktopFsaNO6DfU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jianlin Shi , Xin Long , "David S. Miller" , Sasha Levin Subject: [PATCH 3.18 080/185] sit: fix IFLA_MTU ignored on NEWLINK Date: Mon, 28 May 2018 12:02:01 +0200 Message-Id: <20180528100057.471581620@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long [ Upstream commit 2b3957c34b6d7f03544b12ebbf875eee430745db ] Commit 128bb975dc3c ("ip6_gre: init dev->mtu and dev->hard_header_len correctly") fixed IFLA_MTU ignored on NEWLINK for ip6_gre. The same mtu fix is also needed for sit. Note that dev->hard_header_len setting for sit works fine, no need to fix it. sit is actually ipv4 tunnel, it can't call ip6_tnl_change_mtu to set mtu. Reported-by: Jianlin Shi Signed-off-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/ipv6/sit.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -1572,6 +1572,13 @@ static int ipip6_newlink(struct net *src if (err < 0) return err; + if (tb[IFLA_MTU]) { + u32 mtu = nla_get_u32(tb[IFLA_MTU]); + + if (mtu >= IPV6_MIN_MTU && mtu <= 0xFFF8 - dev->hard_header_len) + dev->mtu = mtu; + } + #ifdef CONFIG_IPV6_SIT_6RD if (ipip6_netlink_6rd_parms(data, &ip6rd)) err = ipip6_tunnel_update_6rd(nt, &ip6rd);