Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5018238rwb; Mon, 31 Jul 2023 16:52:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlFo8FNF2OKTbfBokZFfXKKTgip1iM0isJXqs9rG+G3z1dO+5rQThQf2EIkZC16aGQBZRTn2 X-Received: by 2002:aa7:d892:0:b0:521:e544:f3 with SMTP id u18-20020aa7d892000000b00521e54400f3mr773439edq.41.1690847574748; Mon, 31 Jul 2023 16:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690847574; cv=none; d=google.com; s=arc-20160816; b=sl/qEupyie1Gbhj1l1mG244mywmGFTdC37eiWISg3Rj5v1swYeiyEfjdTouTe9d4oQ FvOWYM1jB/8evRZmKy9UyxGi1RGou7XllIVB0fzBH29fr4Lbiq/wzJfi1I2sY+uZvAPl xKh0CA+lHK6txi4033wRHR/s7nhcODMSxLsQuGnEJC0i0IyMYAohdRDY9XnRrWym5blU eswqrK3o6ua1sb74ChhIWUo3hELNGPmWNxdVMOi+fWnccRkuXI2VT4o44exW4mRlOwqh Aj45FfvKjpj73GZ+Go7mYM/dTjVxllV84azoHXegY1dCJr9jnpPja1xhCHRT3qgBrg7F HieQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=r3NTgG4qLC9ZQhYXCs1UXPjCX4mwEQOdjG4bzdifxkI=; fh=mlUlAg4LX8l3BlPnu2Tt9s+AiVRMQWybU6F1WHy9RcM=; b=psenk9BRuoxe8gl+7zoAijatV4JkEJac5TJdkO2j19UO8k0UVxOSp92jYhI971D46U VeznrroGyh4UBGin/bFLGvxojxu/PLVgBSGT+XX5czZXaasg1mM3DaJgVpdWlf3SYhVV 0wT8mHopJjOgh08dGaK0JRrfHVNyXCOnGHe8ZR35YiOVRZNHuj3CA5OTgQbpPJ4iXYRR +SWrmxAc6NN/q+UK22DELN8BLilXRID7fLmCs0H3W5R4RTqF9A3OH0/vc6LOPF7VXXIL u4QEcqSwh8XCW2E9rnEVRMjqwSUYgCiEfe5Pm0l/tQe/rryUUBIpp+gIs+wQ7IAqBx/U HiEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b=vZylnhrk; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=dNQcqzLX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g21-20020aa7c595000000b0052259d33818si7277841edq.33.2023.07.31.16.52.30; Mon, 31 Jul 2023 16:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b=vZylnhrk; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=dNQcqzLX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231636AbjGaVzp (ORCPT + 99 others); Mon, 31 Jul 2023 17:55:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231745AbjGaVzh (ORCPT ); Mon, 31 Jul 2023 17:55:37 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6FFD1FF0; Mon, 31 Jul 2023 14:55:28 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D9D515C019E; Mon, 31 Jul 2023 17:55:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 31 Jul 2023 17:55:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1690840525; x=1690926925; bh=r3NTgG4qLC 9ZQhYXCs1UXPjCX4mwEQOdjG4bzdifxkI=; b=vZylnhrkSW7MBNL5YAgTv8djUG eySXV57dXy3KGxs0C8lSaKf0v5rs+upnskhR4UugPFDd/W+bbDyTeQShUAtOSHdE FljVCmrDRsw0+IOasPj44TCglOZ9puA8wEa7tTGeEhYnhuEZvhZhO7s5y3YNmbui f/4OcLGnD/7UX0+qb/RTsQR72lLyOhwcHRUfsHuUREu0Cl9u/xmxfSfVe7oTH0tV vfi4ZpIKRpLY8o/Oz4Bmuy761Haq+bE9/y1wXy/jJz6L1HrPnHDATfWUtY+HzKx4 GrrKI7QlGp3Dv5YyKqO8C4Mv4o/FVsCAULc+OAuCvFgbI3wesULxHyBs/dpg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1690840525; x=1690926925; bh=r3NTgG4qLC9ZQ hYXCs1UXPjCX4mwEQOdjG4bzdifxkI=; b=dNQcqzLXz1LBlJZBUinplkmVHEYaC ssgVLtML0avz4wnTdONP2fhO/yK9kgveKbr4UW7zU9NVsFOjRGTWpj29lWMdgZpC 2SSWPNoL3n44oIZG2duAeUpbRnDArEllrLsmZQXZ98AzaCv0hAOqeuAXL6GJsSZS MN3uubIVLporrz3mz4jIClUzXo/PSatE8OVgtxEYx38j0zCT7IRTzE+UeLyf/XJQ zLcWq6S8sVjQNxyfgVW/OWb4ubpKKCIZxYEKOS+4hjvb65SBxOvAPn2hc90n2xDC qvZABoJcR8vmyRhbs+ySwLx9pzxTtUKkD6EXBt6t6kVh2D2ZaKVZZv52w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrjeehgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculddvfedmnecujfgurhephffvve fufffkofgggfestdekredtredttdenucfhrhhomhepffgrnhhivghlucgiuhcuoegugihu segugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpeetueektdeuhfefvefggfevge ffgfekfefhkeekteffheevtddvhedukeehffeltdenucffohhmrghinhepkhgvrhhnvghl rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Jul 2023 17:55:24 -0400 (EDT) From: Daniel Xu To: kadlec@netfilter.org, davem@davemloft.net, pabeni@redhat.com, dxu@dxuuu.xyz, ast@kernel.org, edumazet@google.com, pablo@netfilter.org, kuba@kernel.org, fw@strlen.de Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kernel test robot Subject: [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary Date: Mon, 31 Jul 2023 15:55:00 -0600 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before, we were getting this warning: net/netfilter/nf_bpf_link.c:32:1: warning: 'get_proto_defrag_hook' defined but not used [-Wunused-function] Guard the definition with CONFIG_NF_DEFRAG_IPV[4|6]. Fixes: 91721c2d02d3 ("netfilter: bpf: Support BPF_F_NETFILTER_IP_DEFRAG in netfilter link") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307291213.fZ0zDmoG-lkp@intel.com/ Signed-off-by: Daniel Xu --- net/netfilter/nf_bpf_link.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/netfilter/nf_bpf_link.c b/net/netfilter/nf_bpf_link.c index 8fe594bbc7e2..e502ec00b2fe 100644 --- a/net/netfilter/nf_bpf_link.c +++ b/net/netfilter/nf_bpf_link.c @@ -28,6 +28,7 @@ struct bpf_nf_link { const struct nf_defrag_hook *defrag_hook; }; +#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV4) || IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) static const struct nf_defrag_hook * get_proto_defrag_hook(struct bpf_nf_link *link, const struct nf_defrag_hook __rcu *global_hook, @@ -68,6 +69,7 @@ get_proto_defrag_hook(struct bpf_nf_link *link, return hook; } +#endif static int bpf_nf_enable_defrag(struct bpf_nf_link *link) { -- 2.41.0