Received: by 10.223.176.5 with SMTP id f5csp893815wra; Sat, 3 Feb 2018 12:47:08 -0800 (PST) X-Google-Smtp-Source: AH8x226dSv/F3nEUjWY/c4uXIZC8kJs4phQvGUe35wFV7h4KUrGH7wqFrdMTm0JTk9s/9PS6Jx/w X-Received: by 10.98.70.18 with SMTP id t18mr44202231pfa.14.1517690828761; Sat, 03 Feb 2018 12:47:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517690828; cv=none; d=google.com; s=arc-20160816; b=w72rhiDw+EsDg1bZuWVHQB0p8Kk15DmLGRno04bV9MmgwQD8W7BVcE7IvTML3VzN0M elY428SXGBWcfiw5HvR2brdlVBm3XaqjpDnwmXW6hX0XByw0XEQedl1rjFVwhrIjbz5g EKFVjZT73TFWTkeh8Jgi7JSy08eMNCnWsWGtnH+rZrkfSmx3bQXvxu21X4o21x4KvpLL ID5Hs0p45hATpkRwaCNKul+T/j5Vm6oYaq40NSpewLb4Id0z0e+WJCWRNt6/ctseOdvW OwIL5rZk8U25SW5HS7G1SXjvvhaRFxZygAoICFWFWsbyZ2LKMo2ACSLZMpiA0tObfzm8 jl2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Iu9PLB4fn7toBj683+PFGHIwW6V6tejlzX83b6ABBDU=; b=BYAr1QmgopwzSdisV7gkD+G/R4+uTtzTKkB2AIhJy9CSwcaKDilOBPzrInHXGefdB9 8KFX2X9quwo94K3OQXyf/PRdCw89EUHJJenbHaBQEQ78LDhYdcFPu9muLM2Mf6nmNbtH 2K1KnTmEeUjuqY6NOA/+9UPN20xNqTr5HYIBHp4pInz7ZJNEfAb3Va38q7pj4F6sIa6E K1IUAzvhrtrFJfZ9Si8J0a7H5Mp0v7Wmy4cVszine2+/iiOWzICgrTHQ7//jBbGiQ7l5 t5/zbAmmpA27aLeM+eeEBAujnYnorT6fEtA92Bdiou5FQ+vzx6uoMi89IrQIj88+stRQ AKXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=lH0di4Dn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m27si3366805pgn.667.2018.02.03.12.46.53; Sat, 03 Feb 2018 12:47:08 -0800 (PST) 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=@microsoft.com header.s=selector1 header.b=lH0di4Dn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754792AbeBCSfh (ORCPT + 99 others); Sat, 3 Feb 2018 13:35:37 -0500 Received: from mail-by2nam03on0136.outbound.protection.outlook.com ([104.47.42.136]:45129 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753297AbeBCSEL (ORCPT ); Sat, 3 Feb 2018 13:04:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Iu9PLB4fn7toBj683+PFGHIwW6V6tejlzX83b6ABBDU=; b=lH0di4Dng8KxmlGXGQGVs9WXyCJ4cKiZZHJG0/uzrtLs6OPeOPhaAKFh7e//bNZsrAQNGXjld6ktHchRqZxc82OhwH+riheA2H7Q3Qrzn/JeYUqcMD4xztuQ+mGZ0T9lxBqq63CKeQ9KzylCa2AYzBCHr6JAg8XSUYKr7p5Sf6Q= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1105.namprd21.prod.outlook.com (52.132.24.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.485.5; Sat, 3 Feb 2018 18:02:07 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:02:07 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Xin Long , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 071/110] ip6_tunnel: allow ip6gre dev mtu to be set below 1280 Thread-Topic: [PATCH AUTOSEL for 4.14 071/110] ip6_tunnel: allow ip6gre dev mtu to be set below 1280 Thread-Index: AQHTnRj8VA+Z9fEDMEek4X091If8iA== Date: Sat, 3 Feb 2018 18:01:15 +0000 Message-ID: <20180203180015.29073-71-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1105;7:8A71FmEao6E2NJxwV5MGhV/lxMLJA03T60KvzI1IAPkDk47eMAuw/Eim8uzIbX1ET0Etg66sS+RbvJKK98bBFzb2Kx4eHJmrjkEQNkBGJVOgST+K0vnsE+cFlIBhaIMAIM91Ku/TWQWas7tE0bwIRyd3V91uFkjdeTakYtuKO4cbbsowJAuhK1nCx2cqmfrlVtyTUmZdMuxRuD8IT0Ou/N6N+JE+r6wvj40YfC6IUidcGwl8IV99gHdRz7Mj7Szp x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c1562d0b-8876-4e77-f03d-08d56b303d2c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1105; x-ms-traffictypediagnostic: BL0PR2101MB1105: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231101)(2400082)(944501161)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:BL0PR2101MB1105;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1105; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39380400002)(39860400002)(346002)(376002)(199004)(189003)(6346003)(97736004)(6512007)(7736002)(26005)(305945005)(102836004)(105586002)(68736007)(5250100002)(8936002)(6486002)(6436002)(106356001)(6506007)(81166006)(81156014)(2501003)(2906002)(10090500001)(99286004)(66066001)(54906003)(6116002)(3846002)(36756003)(1076002)(8676002)(110136005)(575784001)(39060400002)(107886003)(72206003)(2950100002)(478600001)(10290500003)(22452003)(6666003)(5660300001)(2900100001)(4326008)(25786009)(14454004)(316002)(86362001)(53936002)(3280700002)(186003)(3660700001)(76176011)(86612001)(22906009)(32563001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1105;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: GbFfILlf0Ouq7V4rLkFlbpg2ePsjb4ajNASl+H1yx0dWvjAXmOGDQ/XLEyck36Fn05ZQBdfz4i07PFvjhYn+Tg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1562d0b-8876-4e77-f03d-08d56b303d2c X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:01:15.8315 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1105 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xin Long [ Upstream commit 2fa771be953a17f8e0a9c39103464c2574444c62 ] Commit 582442d6d5bc ("ipv6: Allow the MTU of ipip6 tunnel to be set below 1280") fixed a mtu setting issue. It works for ipip6 tunnel. But ip6gre dev updates the mtu also with ip6_tnl_change_mtu. Since the inner packet over ip6gre can be ipv4 and it's mtu should also be allowed to set below 1280, the same issue also exists on ip6gre. This patch is to fix it by simply changing to check if parms.proto is IPPROTO_IPV6 in ip6_tnl_change_mtu instead, to make ip6gre to go to 'else' branch. Signed-off-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv6/ip6_tunnel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index c3e963a2a017..1161fd5630c1 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1684,11 +1684,11 @@ int ip6_tnl_change_mtu(struct net_device *dev, int = new_mtu) { struct ip6_tnl *tnl =3D netdev_priv(dev); =20 - if (tnl->parms.proto =3D=3D IPPROTO_IPIP) { - if (new_mtu < ETH_MIN_MTU) + if (tnl->parms.proto =3D=3D IPPROTO_IPV6) { + if (new_mtu < IPV6_MIN_MTU) return -EINVAL; } else { - if (new_mtu < IPV6_MIN_MTU) + if (new_mtu < ETH_MIN_MTU) return -EINVAL; } if (new_mtu > 0xFFF8 - dev->hard_header_len) --=20 2.11.0