]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: conntrack: avoid useless indirection during conntrack destruction
authorFlorian Westphal <fw@strlen.de>
Fri, 7 Jan 2022 04:03:25 +0000 (05:03 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 9 Jan 2022 22:30:13 +0000 (23:30 +0100)
commit93ea41226a7682d4bcfe213afd317e8bf7ef4ed1
treee351c62322a77c4fe66cb8382070fb5d69db0b63
parent69b2fa45c27c36a2e2e95356c193be7867d17e01
netfilter: conntrack: avoid useless indirection during conntrack destruction

nf_ct_put() results in a usesless indirection:

nf_ct_put -> nf_conntrack_put -> nf_conntrack_destroy -> rcu readlock +
indirect call of ct_hooks->destroy().

There are two _put helpers:
nf_ct_put and nf_conntrack_put.  The latter is what should be used in
code that MUST NOT cause a linker dependency on the conntrack module
(e.g. calls from core network stack).

Everyone else should call nf_ct_put() instead.

A followup patch will convert a few nf_conntrack_put() calls to
nf_ct_put(), in particular from modules that already have a conntrack
dependency such as act_ct or even nf_conntrack itself.

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