lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <b128b6489f0066db32c4772ae4aaee1480495929.1690840454.git.dxu@dxuuu.xyz>
Date:   Mon, 31 Jul 2023 15:55:00 -0600
From:   Daniel Xu <dxu@...uu.xyz>
To:     kadlec@...filter.org, davem@...emloft.net, pabeni@...hat.com,
        dxu@...uu.xyz, ast@...nel.org, edumazet@...gle.com,
        pablo@...filter.org, kuba@...nel.org, fw@...len.de
Cc:     netfilter-devel@...r.kernel.org, coreteam@...filter.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org, kernel test robot <lkp@...el.com>
Subject: [PATCH] netfilter: bpf: Only define get_proto_defrag_hook() if necessary

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 <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307291213.fZ0zDmoG-lkp@intel.com/
Signed-off-by: Daniel Xu <dxu@...uu.xyz>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ