From patchwork Tue Mar 13 11:44:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 131435 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp622311ljb; Tue, 13 Mar 2018 04:45:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELsIeqjnfo42ud2OXyqqMiYsDUaPoEv8CEWxPxR/dRWPZjEc7KXTNrwNHVc9cJvP1EpoWUao X-Received: by 10.98.117.139 with SMTP id q133mr330156pfc.64.1520941550392; Tue, 13 Mar 2018 04:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520941550; cv=none; d=google.com; s=arc-20160816; b=jZsomcwmgwRtawLKg4PzaBih9NEfYEQ7BBH3ic4WxAHp2ktFP9d2USzT0Dno6paDB2 2eW47ro+cDIMzqHm27Wa80pmmPMWVR2SGbmj/m1DSPA1ZsgJNKwdoQHvPwz3+NZysF4R EAAv3b8jK8QZB3PiQc8/C475mjpPypg6nfmdQvulzzhcGTjAOBN+SRReTBeDlYwOiPp+ qwoapVjFsLTXAXqbIN+KNvVLtCXRMyqlaFLh4IM8fBorEve1ovpmpW8gu1J1k6GFsc83 zOEF378feyu4pWTB/KTTWE6bcomEmNk288IVZf118HBXLYCIteJoyzq4D45VGRwT6HZU Pe8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=q7TXDYeDjigOSGZvCz1LhwYXlij737+BvjF+SXpQXQc=; b=DPtNbFhs8EG2xwmUz+yRRlGR9yDL/KQXszJ2XaGuOvUgl2CsxhuL9M833jubhCV9xo YFFZMHvG519YXqQBNajymdBRb97JHNYv7i0QB1beGWUSkhoKYMacVLUQ63CNOMSzpi6G Tnkmi28FmWhklvEm6XT1mpvCbsd52JQhjInSh/6fLgdQTIJo+WFkt4v88bVbvLTAi3J8 yztbZnBtu/4KLG3wk5Er9YrivH40JnGl8orHWNK8k/JUQWDqVt8nJcsWKBx7qv0XS8aa 5QVEo0PiChgzgxksNS++ByFU/O671sYc6QSocz/h3K06V6jBxZ+keh9askgz0xlBLVDP b6Jw== 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 z2-v6si28104plo.28.2018.03.13.04.45.50; Tue, 13 Mar 2018 04:45:50 -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 S932907AbeCMLpr (ORCPT + 28 others); Tue, 13 Mar 2018 07:45:47 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:37319 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752089AbeCMLpp (ORCPT ); Tue, 13 Mar 2018 07:45:45 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mfeu7-1fJ8Ev0xcx-00P7Mn; Tue, 13 Mar 2018 12:45:18 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: Eric Dumazet , Arnd Bergmann , Jiri Pirko , Daniel Borkmann , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next] net: fix sysctl_fb_tunnels_only_for_init_net link error Date: Tue, 13 Mar 2018 12:44:53 +0100 Message-Id: <20180313114515.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eRNMZs8Y9Jw17/3d5en8EYmGpN7UN6rA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The new variable is only available when CONFIG_SYSCTL is enabled, otherwise we get a link error: net/ipv4/ip_tunnel.o: In function `ip_tunnel_init_net': ip_tunnel.c:(.text+0x278b): undefined reference to `sysctl_fb_tunnels_only_for_init_net' net/ipv6/sit.o: In function `sit_init_net': sit.c:(.init.text+0x4c): undefined reference to `sysctl_fb_tunnels_only_for_init_net' net/ipv6/ip6_tunnel.o: In function `ip6_tnl_init_net': ip6_tunnel.c:(.init.text+0x39): undefined reference to `sysctl_fb_tunnels_only_for_init_net' This adds an extra condition, keeping the traditional behavior when CONFIG_SYSCTL is disabled. Fixes: 79134e6ce2c9 ("net: do not create fallback tunnels for non-default namespaces") Signed-off-by: Arnd Bergmann --- include/linux/netdevice.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 5fbb9f1da7fd..913b1cc882cf 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -589,7 +589,9 @@ extern int sysctl_fb_tunnels_only_for_init_net; static inline bool net_has_fallback_tunnels(const struct net *net) { - return net == &init_net || !sysctl_fb_tunnels_only_for_init_net; + return net == &init_net || + !IS_ENABLED(CONFIG_SYSCTL) || + !sysctl_fb_tunnels_only_for_init_net; } static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)