]> git.baikalelectronics.ru Git - kernel.git/commit
vrf: Fix fast path output packet handling with async Netfilter rules
authorMartin Willi <martin@strongswan.org>
Fri, 6 Nov 2020 07:30:30 +0000 (08:30 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Nov 2020 15:47:06 +0000 (07:47 -0800)
commit27d358a8f059a4f3c9584477316e4c8b991f9f42
treef25d2a077d790df54c8897b9b80ac2455b025c79
parentd14cb38874dfe5ab3664e8312d58e3835e9678ea
vrf: Fix fast path output packet handling with async Netfilter rules

VRF devices use an optimized direct path on output if a default qdisc
is involved, calling Netfilter hooks directly. This path, however, does
not consider Netfilter rules completing asynchronously, such as with
NFQUEUE. The Netfilter okfn() is called for asynchronously accepted
packets, but the VRF never passes that packet down the stack to send
it out over the slave device. Using the slower redirect path for this
seems not feasible, as we do not know beforehand if a Netfilter hook
has asynchronously completing rules.

Fix the use of asynchronously completing Netfilter rules in OUTPUT and
POSTROUTING by using a special completion function that additionally
calls dst_output() to pass the packet down the stack. Also, slightly
adjust the use of nf_reset_ct() so that is called in the asynchronous
case, too.

Fixes: a07c5f7e276a ("net: vrf: performance improvements for IPv4")
Fixes: 345f5718f0e8 ("net: vrf: performance improvements for IPv6")
Signed-off-by: Martin Willi <martin@strongswan.org>
Link: https://lore.kernel.org/r/20201106073030.3974927-1-martin@strongswan.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/vrf.c