If flow is in hardware and not in teardown state, check if flow needs to be removed due to closing, otherwise request for stats updates. Signed-off-by: Pablo Neira Ayuso --- net/netfilter/nf_flow_table_core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c index d5652e45ee04..fd5539bba88e 100644 --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c @@ -605,12 +605,12 @@ static void nf_flow_offload_gc_step(struct nf_flowtable *flow_table, } else { flow_offload_del(flow_table, flow); } - } else if (test_bit(NF_FLOW_CLOSING, &flow->flags) && - test_bit(NF_FLOW_HW, &flow->flags) && + } else if (test_bit(NF_FLOW_HW, &flow->flags) && !test_bit(NF_FLOW_HW_DYING, &flow->flags)) { - nf_flow_offload_del(flow_table, flow); - } else if (test_bit(NF_FLOW_HW, &flow->flags)) { - nf_flow_offload_stats(flow_table, flow); + if (test_bit(NF_FLOW_CLOSING, &flow->flags)) + nf_flow_offload_del(flow_table, flow); + else + nf_flow_offload_stats(flow_table, flow); } } -- 2.47.3