netfilter: nft_flow_offload: add entry to flowtable after confirmation
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 29 Apr 2019 09:54:56 +0000 (11:54 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Apr 2019 11:48:23 +0000 (13:48 +0200)
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: a3c90f7a2323 ("netfilter: nf_tables: flow offload expression")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_flow_offload.c

index 6e6b9adf7d387717ff6f99a87093e41478c9889f..8968c7f5a72e03824141d69501226826fd433514 100644 (file)
@@ -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))