From patchwork Mon Mar 4 20:38:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 159617 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp4188150jad; Mon, 4 Mar 2019 12:38:41 -0800 (PST) X-Google-Smtp-Source: APXvYqy3mNtqL1MoZbTzM/WVpmvBycE6jCAyd0UnbckHp5RIZAoxj4BxRaQ7AjC3JCcUrLGJValu X-Received: by 2002:a17:902:4503:: with SMTP id m3mr22034596pld.35.1551731921802; Mon, 04 Mar 2019 12:38:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551731921; cv=none; d=google.com; s=arc-20160816; b=uhd3Grp9/i4f/aT+8lj/2M3omvF6qnf+q2KI4e2+N5rl2fP2/346oL7CQBbnZOcQbR vOjL9uELw/0MNWPyHNgGE5c6ZITwg6Zy9TMnZmhwT0pfsp0sUoh0IBZZYKj3qsBhrXQC h6/pts7ObLxBYHZk3NIbEJEKglx9EZHpAeXQtavWzTIhOlL1Lho5zPMMi8PEXNveKDVO xQnFu2PIIXgc8tdKWLlwFVG2/rxkSH955XgTjDZvnhizLVzrWQzR0q1WAxMdZ8WKBr3J hDPDlsneNHENNw3yi179nyNanoiyUgYphGrNn9xEPqi0fe8OEk97DrKSmeBOjVcE2koj smuQ== 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 :message-id:date:subject:cc:to:from; bh=yR/av9HVD1UjtLXI0vWLhhBN/70jdv2YGkd1t5zmrsY=; b=uJATCojhS6SIovRCNFgf+GRYVZNgHoXj3Gp4W37IJ63nbACAIBC0B6BVkFQVBhPPfi LNtC+sn7M2eR+EGs0eMYDBERL3+g14NdRp+kNxsIcSA0dvWKaTagBhrh150kY1QrcIuR y8FQalixJPjAjlaI+tyMVALSqYvGn63/IEQto4AUREMSSF+n+4z60pFSwa5gN7XAV5x7 jNs3+/Fz2PTXWzGY1O53P/zqCZkXOHoudDfocws3ksqd62s1ELAoSriAc8u90wRcY/XQ ckS6dNJXUqjOWRTThx6sav9R7euAXl0wTuAkkGPycW4ru8S8Hz323NW+32+KM6RJez6e oerA== 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 p65si6122294pfa.27.2019.03.04.12.38.41; Mon, 04 Mar 2019 12:38:41 -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; 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 S1726648AbfCDUik (ORCPT + 31 others); Mon, 4 Mar 2019 15:38:40 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:54903 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbfCDUij (ORCPT ); Mon, 4 Mar 2019 15:38:39 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1M58OQ-1gzntI03fA-0018L2; Mon, 04 Mar 2019 21:38:28 +0100 From: Arnd Bergmann To: "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI Cc: Zhu Yanjun , Tonghao Zhang , Nicolas Dichtel , Arnd Bergmann , David Ahern , Christian Brauner , Xin Long , Cong Wang , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: ignore sysctl_devconf_inherit_init_net without SYSCTL Date: Mon, 4 Mar 2019 21:38:03 +0100 Message-Id: <20190304203822.2094613-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:TnilO3lewj64uim7MWi4MdhUWNKmPKRRsNaiZ6G5qnw+GpZyr9I ov8XwQyobzhZNYM++/l4Rwiehs/Y4doVZ+94G8h2KoSdzpT9+mBU/YJIWGvZfJEVGXgg/eK ft0xb6UpP3xauuapeFIKsULHPCAkW/NhyqeCOktfzPfEfI45qUhnQqmE9MZlAXv+15OMdzW V2YfeiOfMkZHdk+Hiztnw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:lJYKhv6F69k=:OALJeCLsYLqy9GJB33e9xm kBqCpfFgvsYLHVMjT7ioRkYDQUELqdhVchJXJahMQ0GjIrqFodZoHnIILJQi1dUMF8Utvfsbv i1hk5K/uuS9uw5ithkzgpDpwas9eS9S9bw+UhnS67uPb/HGXZCMXC8TT1oaUYrf4HqYw1mZti 3iQqMHiA7oNuozK5LAiWTbh3+bLStmCuaoNae0TCjUtrbmrWs6Neq67ZIlJh5G9/SDs1vHMFd chcnl9I24Sg2dMMH7FQEclKBiz6nJ0bEzorYuD3JPK8MCK7dQ23iWIQ7bIZYuzijJdBXkpcCq 52efS3WIzpuANOv3j0lyjV9y6bObGIqCplotpQa5R48OZMLBKawGy8bZWPs21sBIqLYU9d9d+ e/mopFQkPRsIlzmTEzVZH+0ah0EhEJ/v1EsYvLsujDDIaY12PQtIWCZNzRB2lQhG6KffK5Dml u01BY5a3fzWCz/YjAkQQ6deCnoZ8C1tWW9JqRJsAoiA5PfvGJ4H60qXMZbT5xnt5+Fruvdqo4 sk4sg1O+zqLqUnM4EtmomumPrYh/3MkHrBOaAxvUoVlAwXmHy4JmJoxjUr/0jcuqL2tgbYezB VjH67AnxCbeCyDQpjqtZjWBlge15U8S/5+PJy/vuxYxTgrI8jVdFW+NJ+wc2e1ENNMu/CLQVw wsXrQR0Ek2JVc0C9jvZ30H0/jJSB3R06/gw/Li5C3lr3KjAcpAhu6lan4y1G/1wSZA6rsuz9g rblxa7QzxDfvhOdcy+Ds30Mq9bpfvP0QBoCLDA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_SYSCTL is turned off, we get a link failure for the newly introduced tuning knob. net/ipv6/addrconf.o: In function `addrconf_init_net': addrconf.c:(.text+0x31dc): undefined reference to `sysctl_devconf_inherit_init_net' Add an IS_ENABLED() check to fall back to the default behavior (sysctl_devconf_inherit_init_net=0) here. Fixes: 856c395cfa63 ("net: introduce a knob to control whether to inherit devconf config") Signed-off-by: Arnd Bergmann --- net/ipv4/devinet.c | 4 +++- net/ipv6/addrconf.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) -- 2.20.0 Acked-by: Christian Brauner diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index cd9033245b98..eb514f312e6f 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -2614,7 +2614,9 @@ static __net_init int devinet_init_net(struct net *net) tbl[0].extra2 = net; #endif - if (sysctl_devconf_inherit_init_net != 2 && !net_eq(net, &init_net)) { + if ((!IS_ENABLED(CONFIG_SYSCTL) || + sysctl_devconf_inherit_init_net != 2) && + !net_eq(net, &init_net)) { memcpy(all, init_net.ipv4.devconf_all, sizeof(ipv4_devconf)); memcpy(dflt, init_net.ipv4.devconf_dflt, sizeof(ipv4_devconf_dflt)); } diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index da5a21050ba9..4ae17a966ae3 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -6905,7 +6905,8 @@ static int __net_init addrconf_init_net(struct net *net) if (!dflt) goto err_alloc_dflt; - if (sysctl_devconf_inherit_init_net == 1 && !net_eq(net, &init_net)) { + if (IS_ENABLED(CONFIG_SYSCTL) && + sysctl_devconf_inherit_init_net == 1 && !net_eq(net, &init_net)) { memcpy(all, init_net.ipv6.devconf_all, sizeof(ipv6_devconf)); memcpy(dflt, init_net.ipv6.devconf_dflt, sizeof(ipv6_devconf_dflt)); }