]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_nat_masquerade: make async masq_inet6_event handling generic
authorFlorian Westphal <fw@strlen.de>
Wed, 15 Sep 2021 14:46:38 +0000 (16:46 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 21 Sep 2021 01:46:56 +0000 (03:46 +0200)
commit37359ddaf7ae91143bfe63ec1df1fd70e14c4896
treec25c0a6a8728733cf1dfcc5a4f4ef0ace056f808
parent0a93d615739a9a86b1e6c2e1e5fbd3ba14d63273
netfilter: nf_nat_masquerade: make async masq_inet6_event handling generic

masq_inet6_event is called asynchronously from system work queue,
because the inet6 notifier is atomic and nf_iterate_cleanup can sleep.

The ipv4 and device notifiers call nf_iterate_cleanup directly.

This is legal, but these notifiers are called with RTNL mutex held.
A large conntrack table with many devices coming and going will have severe
impact on the system usability, with 'ip a' blocking for several seconds.

This change places the defer code into a helper and makes it more
generic so ipv4 and ifdown notifiers can be converted to defer the
cleanup walk as well in a follow patch.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_nat_masquerade.c