]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_flow_table: fix offload for flows that are subject to xfrm
authorFlorian Westphal <fw@strlen.de>
Tue, 30 Jul 2019 12:57:19 +0000 (14:57 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 5 Aug 2019 09:29:50 +0000 (11:29 +0200)
commitc28670fc388d67f084c8b3f341b2e3e4952fda16
treea176577f83fccfb37a35fff25d79ca75d61be487
parentdbe9c665c2c29eea28769616c5a1b1d21eb83b51
netfilter: nf_flow_table: fix offload for flows that are subject to xfrm

This makes the previously added 'encap test' pass.
Because its possible that the xfrm dst entry becomes stale while such
a flow is offloaded, we need to call dst_check() -- the notifier that
handles this for non-tunneled traffic isn't sufficient, because SA or
or policies might have changed.

If dst becomes stale the flow offload entry will be tagged for teardown
and packets will be passed to 'classic' forwarding path.

Removing the entry right away is problematic, as this would
introduce a race condition with the gc worker.

In case flow is long-lived, it could eventually be offloaded again
once the gc worker removes the entry from the flow table.

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