]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: fix flowtable free
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 6 Feb 2018 12:22:47 +0000 (13:22 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 6 Feb 2018 23:58:57 +0000 (00:58 +0100)
commit949c4cdd69a8cb9a89fd7f7ee9eed2294363f389
treecd33d1bcfebc1bc0bdddef0379b57eb28ef20131
parent115b41fc6e9e46039201895fc68434fc86ee60b4
netfilter: nf_tables: fix flowtable free

Every flow_offload entry is added into the table twice. Because of this,
rhashtable_free_and_destroy can't be used, since it would call kfree for
each flow_offload object twice.

This patch cleans up the flowtable via nf_flow_table_iterate() to
schedule removal of entries by setting on the dying bit, then there is
an explicitly invocation of the garbage collector to release resources.

Based on patch from Felix Fietkau.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_flow_table.h
net/ipv4/netfilter/nf_flow_table_ipv4.c
net/ipv6/netfilter/nf_flow_table_ipv6.c
net/netfilter/nf_flow_table.c
net/netfilter/nf_flow_table_inet.c
net/netfilter/nf_tables_api.c