]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_nat_masquerade: defer conntrack walk to work queue
authorFlorian Westphal <fw@strlen.de>
Wed, 15 Sep 2021 14:46:39 +0000 (16:46 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 21 Sep 2021 01:46:56 +0000 (03:46 +0200)
commitc7a9c0ad91cf6c5cd8d2b6c0965e8d162fc7a38f
treed11f0977fa5435e61a357c7138a71eeae8a1f41b
parenta84b56e7b6f8b65b458856008844c6ac00aa7ae1
netfilter: nf_nat_masquerade: defer conntrack walk to work queue

The ipv4 and device notifiers are called with RTNL mutex held.
The table walk can take some time, better not block other RTNL users.

'ip a' has been reported to block for up to 20 seconds when conntrack table
has many entries and device down events are frequent (e.g., PPP).

Reported-and-tested-by: Martin Zaharinov <micron10@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_nat_masquerade.c