]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Sep 2019 05:18:01 +0000 (07:18 +0200)
commit 110e48725db6262f260f10727d0fb2d3d25895e4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_flow_table_core.c

index 49248fe5847a1aec06ba65c9b414e790acfedef5..55106bebf2b5873773e510235580e59f92679948 100644 (file)
@@ -218,7 +218,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);