]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: prefer extension check to pointer check
authorFlorian Westphal <fw@strlen.de>
Mon, 25 Apr 2022 13:15:44 +0000 (15:15 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 13 May 2022 16:56:28 +0000 (18:56 +0200)
commite93b052c970ab47d535ffcc44c9d8ed1c5145f9c
tree178f82135ed388c543d2853de79635b1eda253ab
parent70bc2a1ffe92319716b9f8d5c4a29433eb13172b
netfilter: prefer extension check to pointer check

The pointer check usually results in a 'false positive': its likely
that the ctnetlink module is loaded but no event monitoring is enabled.

After recent change to autodetect ctnetlink usage and only allocate
the ecache extension if a listener is active, check if the extension
is present on a given conntrack.

If its not there, there is nothing to report and calls to the
notification framework can be elided.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_conntrack_core.h
include/net/netfilter/nf_conntrack_ecache.h