Skip to content

Commit

Permalink
netfilter: nft_flow_offload: add entry to flowtable after confirmation
Browse files Browse the repository at this point in the history
This is fixing flow offload for UDP traffic where packets only follow
one single direction.

The flow_offload_fixup_tcp() mechanism works fine in case that the
offloaded entry remains in SYN_RECV state, given sequence tracking is
reset and that conntrack handles syn+ack packets as a retransmission, ie.

	sES + synack => sIG

for reply traffic.

Fixes: a3c90f7 ("netfilter: nf_tables: flow offload expression")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Pablo Neira Ayuso committed Apr 30, 2019
1 parent 66293c4 commit 270a8a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/netfilter/nft_flow_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ static void nft_flow_offload_eval(const struct nft_expr *expr,
if (help)
goto out;

if (ctinfo == IP_CT_NEW ||
ctinfo == IP_CT_RELATED)
if (!nf_ct_is_confirmed(ct))
goto out;

if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
Expand Down

0 comments on commit 270a8a2

Please sign in to comment.