Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp724614imm; Thu, 13 Sep 2018 06:52:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYQU296/IVtTSKpC3rQdPd0LB5deb5YhTrYqo2GrDNE96Q+MoPKXte/uz+AX6gmo4Xuk9xE X-Received: by 2002:a17:902:2e01:: with SMTP id q1-v6mr7538136plb.40.1536846750975; Thu, 13 Sep 2018 06:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536846750; cv=none; d=google.com; s=arc-20160816; b=glTbvN6aD1jpZ706lp0yyCbN6OQbKkc6/TOFoZG7ZGNgZitM/Uy2PrrLg7ZB/AIjLa HFsUPZxF6fQJ0tkHDmvoIeXQH04cDHO4lT3mnQyF2smDXlCIObqZ/xG9Y+M4EKQ7OstL 0YR7IqT4Av9Nb3n68Wog9o5DP0XwAih2wuvztFzbU4z8wSG3DL9iRm6/yYY4R5luQnYu 4tq4LtUGYKkzDCyu9iJ3MclchVy0UpXYoCfC5zwcJwHmt+UhEKaK5QSxEfeI/LuGkJvJ BNNpYNVs/QKOn7sJS6nh2ArXNw7kqm1oHVtxHkZ/XqSSA/gT+JkVSzbqO1KjELB/QYwH /CIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=Da9TlvwzCXE/wFD+x25Q8cvIKL0WBL7TJzpCidjjZT8=; b=0hv9YsKFZ5xuJQ07qgM9KJ+i6cLqsfEb7JKkfkG4S5cNXEEz8QRdHoKzvDhrUvVenG 5bGmj7UalHAf3wyASLc8N6TS7PJ/U2843o3Q9Ch+vs5+vOMQr6pXHTStUdCPi7FR3zRi JKjSchT3pubd8VsIOQeUVLg4clMiu/7J1J25fb4ZCaI4kJeHoturtv+AEb1M0b7RffYa JiRYM7KQpbmVXF78X3jeKbdXpV8GIBM7EEi07pyoCIw5WNKubT8QX8iIqy9JStQnx5dq U5Iyn5Kj01rTEhR9xC+4HObyxOc33X4n77l4P6neyXDR/DMt4yc4wGYyvkKGMUGIEy5G /JVA== ARC-Authentication-Results: i=1; mx.google.com; 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 o20-v6si4159077pgd.58.2018.09.13.06.52.15; Thu, 13 Sep 2018 06:52:30 -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; 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 S1730916AbeIMTBc (ORCPT + 99 others); Thu, 13 Sep 2018 15:01:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33364 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730390AbeIMTBa (ORCPT ); Thu, 13 Sep 2018 15:01:30 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 80A69D10; Thu, 13 Sep 2018 13:51:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Haishuang Yan , "David S. Miller" Subject: [PATCH 4.18 030/197] ip6_vti: fix creating fallback tunnel device for vti6 Date: Thu, 13 Sep 2018 15:29:39 +0200 Message-Id: <20180913131842.770438695@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Haishuang Yan [ Upstream commit e2948e5af8eeb6c945000772b7613b0323a0a203 ] When set fb_tunnels_only_for_init_net to 1, don't create fallback tunnel device for vti6 when a new namespace is created. Tested: [root@builder2 ~]# modprobe ip6_tunnel [root@builder2 ~]# modprobe ip6_vti [root@builder2 ~]# echo 1 > /proc/sys/net/core/fb_tunnels_only_for_init_net [root@builder2 ~]# unshare -n [root@builder2 ~]# ip link 1: lo: mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 Signed-off-by: Haishuang Yan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_vti.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c @@ -1114,6 +1114,8 @@ static int __net_init vti6_init_net(stru ip6n->tnls[0] = ip6n->tnls_wc; ip6n->tnls[1] = ip6n->tnls_r_l; + if (!net_has_fallback_tunnels(net)) + return 0; err = -ENOMEM; ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6_vti0", NET_NAME_UNKNOWN, vti6_dev_setup);