From patchwork Tue May 29 09:55:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 137132 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3837069lji; Tue, 29 May 2018 02:55:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq12xH0lI0S+v6ob3m3bvjf1i86wQDFMu2UkLTGLNOcfVoW1mfOencLZ3sJ2jQZ4v9HrqLq X-Received: by 2002:a63:65c4:: with SMTP id z187-v6mr13015048pgb.180.1527587755647; Tue, 29 May 2018 02:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527587755; cv=none; d=google.com; s=arc-20160816; b=FiNaNrIWOtfL9TcnTitASyoYKbTZrjK+6p0zRRkubsuNnGJ0rPZSxheduAr19kvsbX rbVDUS2kS7lm0UOUWUKp3oq3yY6XeuH8m6ibhsiSBzn9RXAJTlvAhXJWjfNInPqP0UK9 diSjTNhkJUkO5oigE1GvUIrcmni7GZrGaKaoWaZ80T8GfnvQgrXQgBE6JWrnW9mnN8hB cznrMwU5IWLWXXsPab2SQevdTt1dY5MpNMX0vGDD7wcVheZj4JsCnYbhOhGqwKL1mv7I FDQxL24ty2MVKnsBIO8pb7ODALoTxJ5MsDYTqWMBzn+P9OcmnzdQOalbEHMjOjGlJrm1 Denw== 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=UX5cmg0qNsoOOfJlN4dbU0ltCJb3RgMx2tX2sOF3svA=; b=dJlv0ZksD86AdFnXVNXE4LiwWWww5ntW1OshUQqSykmycass5fVE9wPY1oc/OqlkfJ 3n+CaHEGwmVsZxt0QI0yoJk4EqfJ5nI0ogjv3JGXsbemrQeEtsy44gJJmpkQlsqamyVk dkAG0GVDTywqEg+lNdXUs3AIcOQKEce7bUPT3seCJpRnTdk5IjKC7gK5EVv3djeE+G+U om+HOJoLiAsjSMmKLI+3Skfs3S/CR2YBgDkDD6ioujs/2Lf5QQRKePWwsbRbdTJQ/xuq yrad/mGdZsejp0Fn+nRFjwlCiHGESeJ4O7sb5aGvkx6pDwNPQUGvop/hbU9FTHzgWpj7 GQ4A== 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 x3-v6si31282024plo.62.2018.05.29.02.55.55; Tue, 29 May 2018 02:55:55 -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 S932903AbeE2Jzw (ORCPT + 30 others); Tue, 29 May 2018 05:55:52 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:39205 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932517AbeE2Jzt (ORCPT ); Tue, 29 May 2018 05:55:49 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LnBmv-1fxn2f3DdF-00hQxA; Tue, 29 May 2018 11:55:40 +0200 From: Arnd Bergmann To: "David S. Miller" , Arnd Bergmann , Alexei Starovoitov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bpfilter: fix building without CONFIG_INET Date: Tue, 29 May 2018 11:55:06 +0200 Message-Id: <20180529095535.81934-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:94rEkWMq9Yz8JonxE8X9K3bm1jr1JHvXuPeupWCGFwbf9Fb0QtQ wN/eqJeyx4RFNJJJZwaFsjHvpTA9lkL/gff6LvRNrBCwOB9urmsVyco6JAfh0LZTspcD+Bg trTpLyCi1ciTR0cqtYWePGA1FDdUph6w7bup0VBgInlzIACSE4tV7gAdh5vQHBdSlowxC+Z nCBlz56MHggaM0uVnBx2Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:eUc6/7KvtEA=:FgC8/8nh6dv8pJJWr3x1ne PsR0QrWASMJ7z5Ps7bY3kq5vvaiW7J1rlNBPk+Der4XUiwBeHT2Ly3qw271xTbZnen7Zy2Eaa jPryH12KK+nVLenUeQ6u4viulrZGeoijW7ubIQsrPnwwYbZtPTPDRHngZF1yWy/0Ig6Xs6ZP1 FgQ3Bq1YehBR0goNNPQoV/iCedm/NivXa10yq0Axx11bTyq5FGaHI6jNajSkLiDFkGlQdYsbe cbl7GUjief8KmmlB30JiMzhW3rfjy9xYZa2dcZp/tKXkIxFejGVnGIiKO00IEYD2/LLRiJpS9 O/kqHwgh3UMgAXbH8lcFgUBu8r3HxsYGLUu07iK5AzMLf4zW3fXPXFk4ChDmr2lSeffOtYDw1 76faCC9n0Rkb3Btii1r2w4XrYf8Bb3SraeSKUfI8Ejqly5JQmAc8sCpCjA4Lna8UtxIgVo6JY xzeXnC7TbRZaglo/1MbIp0QOYO0x566EDCG39OBjZ76czFJEZiMi5+a1kZrVTxKbXmDdz9wdA reebS6DJ7ZlhLJlan1fCWOMwM6Im9AOfJePrLEgZnwjdmNLXBJdeF0Eqojq65D+6HC38d7JL6 gX3tlSjuj+g2QgVnkiJMqNUkfij0ATTuNyr/8OI/7pvO1LrhvE+0POew5NU8wDbv6ICTtyEkR DKSywJA4nwYqAQRcvf2CavW/O2eyL4mgQ4tiuHwJc83uVExDszs68excygRq4TNxyl/A= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org bpfilter_process_sockopt is a callback that gets called from ip_setsockopt() and ip_getsockopt(). However, when CONFIG_INET is disabled, it never gets called at all, and assigning a function to the callback pointer results in a link failure: net/bpfilter/bpfilter_kern.o: In function `__stop_umh': bpfilter_kern.c:(.text.unlikely+0x3): undefined reference to `bpfilter_process_sockopt' net/bpfilter/bpfilter_kern.o: In function `load_umh': bpfilter_kern.c:(.init.text+0x73): undefined reference to `bpfilter_process_sockopt' Since there is no caller in this configuration, I assume we can simply make the assignment conditional. Signed-off-by: Arnd Bergmann --- This happened on last week's linux-next tree. Since there hasn't been an update since, it's possible that this is fixed in another tree already. --- net/bpfilter/bpfilter_kern.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/net/bpfilter/bpfilter_kern.c b/net/bpfilter/bpfilter_kern.c index 7596314b61c7..b13d058f8c34 100644 --- a/net/bpfilter/bpfilter_kern.c +++ b/net/bpfilter/bpfilter_kern.c @@ -33,7 +33,8 @@ static void shutdown_umh(struct umh_info *info) static void __stop_umh(void) { - if (bpfilter_process_sockopt) { + if (IS_ENABLED(CONFIG_INET) && + bpfilter_process_sockopt) { bpfilter_process_sockopt = NULL; shutdown_umh(&info); } @@ -98,7 +99,9 @@ static int __init load_umh(void) stop_umh(); return -EFAULT; } - bpfilter_process_sockopt = &__bpfilter_process_sockopt; + if (IS_ENABLED(CONFIG_INET)) + bpfilter_process_sockopt = &__bpfilter_process_sockopt; + return 0; }