Skip to content

Commit 4203b19

Browse files
roidayanummakynes
authored andcommitted
netfilter: flowtable: Set offload timeout when adding flow
On heavily loaded systems the GC can take time to go over all existing conns and reset their timeout. At that time other calls like from nf_conntrack_in() can call of nf_ct_is_expired() and see the conn as expired. To fix this when we set the offload bit we should also reset the timeout instead of counting on GC to finish first iteration over all conns before the initial timeout. Fixes: 9096401 ("netfilter: nf_conntrack: add IPS_OFFLOAD status bit") Signed-off-by: Roi Dayan <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 73f9407 commit 4203b19

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/netfilter/nf_flow_table_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow)
243243
return err;
244244
}
245245

246+
nf_ct_offload_timeout(flow->ct);
247+
246248
if (nf_flowtable_hw_offload(flow_table)) {
247249
__set_bit(NF_FLOW_HW, &flow->flags);
248250
nf_flow_offload_add(flow_table, flow);

0 commit comments

Comments
 (0)