OSDN Git Service

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)
commit589b474a4b7ce409d6821ef17234a995841bd131
treea176577f83fccfb37a35fff25d79ca75d61be487
parent0ca1bbb7f4212aeef83a67a8aed9da1d84567fcc
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