* Re: [netfilter-nf:master 47/47] nf_queue.c:undefined reference to `sock_gen_put'
[not found] <202202250551.bHhoyNSe-lkp@intel.com>
@ 2022-02-24 22:17 ` Florian Westphal
2022-02-24 22:22 ` Florian Westphal
0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2022-02-24 22:17 UTC (permalink / raw)
To: netfilter-devel
Cc: Florian Westphal, kbuild-all, linux-kernel, Pablo Neira Ayuso
kernel test robot <lkp@intel.com> wrote:
[ cc nf-devel ]
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git master
> head: 661c8ec0381915e9a2b0f9dcc03a5bd70ba5e3dd
> commit: 661c8ec0381915e9a2b0f9dcc03a5bd70ba5e3dd [47/47] netfilter: nf_queue: don't assume sk is full socket
> config: arm-randconfig-c002-20220223 (https://download.01.org/0day-ci/archive/20220225/202202250551.bHhoyNSe-lkp@intel.com/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git/commit/?id=661c8ec0381915e9a2b0f9dcc03a5bd70ba5e3dd
> git remote add netfilter-nf git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
> git fetch --no-tags netfilter-nf master
> git checkout 661c8ec0381915e9a2b0f9dcc03a5bd70ba5e3dd
> # save the config file to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> arm-linux-gnueabi-ld: net/netfilter/nf_queue.o: in function `nf_queue_entry_release_refs':
> >> nf_queue.c:(.text+0x60): undefined reference to `sock_gen_put'
CONFIG_NETFILTER=y
CONFIG_DECNET=y
CONFIG_INET=n
I could add ugly ifdef to use sock_put() like before for !INET case.
OTOH, the entire nfqueue infra is doubtful in this config.
Maybe elide that completely? Any advice/preferred solution?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [netfilter-nf:master 47/47] nf_queue.c:undefined reference to `sock_gen_put'
2022-02-24 22:17 ` [netfilter-nf:master 47/47] nf_queue.c:undefined reference to `sock_gen_put' Florian Westphal
@ 2022-02-24 22:22 ` Florian Westphal
0 siblings, 0 replies; 2+ messages in thread
From: Florian Westphal @ 2022-02-24 22:22 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel, Pablo Neira Ayuso
Florian Westphal <fw@strlen.de> wrote:
[ trimmed CC ]
> CONFIG_NETFILTER=y
> CONFIG_DECNET=y
> CONFIG_INET=n
>
> I could add ugly ifdef to use sock_put() like before for !INET case.
> OTOH, the entire nfqueue infra is doubtful in this config.
>
> Maybe elide that completely? Any advice/preferred solution?
Minimal fix would be:
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -46,6 +46,15 @@ void nf_unregister_queue_handler(void)
}
EXPORT_SYMBOL(nf_unregister_queue_handler);
+static void nf_queue_sock_put(struct sock *sk)
+{
+#ifdef CONFIG_INET
+ sock_gen_put(sk);
+#else
+ sock_put(sk);
+#endif
+}
+
static void nf_queue_entry_release_refs(struct nf_queue_entry *entry)
{
struct nf_hook_state *state = &entry->state;
@@ -54,7 +63,7 @@ static void nf_queue_entry_release_refs(struct nf_queue_entry *entry)
dev_put(state->in);
dev_put(state->out);
if (state->sk)
- sock_gen_put(state->sk);
+ nf_queue_sock_put(state->sk);
#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
dev_put(entry->physin);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-24 22:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <202202250551.bHhoyNSe-lkp@intel.com>
2022-02-24 22:17 ` [netfilter-nf:master 47/47] nf_queue.c:undefined reference to `sock_gen_put' Florian Westphal
2022-02-24 22:22 ` Florian Westphal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).