netfilter: nf_flow_table: set default timeout after successful insertion
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 2 Sep 2019 17:37:43 +0000 (19:37 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 3 Sep 2019 20:55:42 +0000 (22:55 +0200)
Set up the default timeout for this new entry otherwise the garbage
collector might quickly remove it right after the flowtable insertion.

Fixes: ac2a66665e23 ("netfilter: add generic flow table infrastructure")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_flow_table_core.c

index 80a8f9ae4c93118d651f6b27f97f1f89bda77cfe..a0b4bf654de2d75765bc27b4ea61c130f32a14a1 100644 (file)
@@ -217,7 +217,7 @@ int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow)
                return err;
        }
 
-       flow->timeout = (u32)jiffies;
+       flow->timeout = (u32)jiffies + NF_FLOW_TIMEOUT;
        return 0;
 }
 EXPORT_SYMBOL_GPL(flow_offload_add);