netfilter: nf_tables: simplify the basic expressions' init routine
authorLiping Zhang <zlpnobody@gmail.com>
Sun, 6 Nov 2016 13:15:51 +0000 (21:15 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 9 Nov 2016 22:42:23 +0000 (23:42 +0100)
commit4e24877e61e8507c0843e4bddbc6ecccbfd2e87d
treef72e0b5c9512c6837d4b278cec75671c107fa5ac
parentf86dab3aa6fef724456ba7e3fae3e2f02414ae86
netfilter: nf_tables: simplify the basic expressions' init routine

Some basic expressions are built into nf_tables.ko, such as nft_cmp,
nft_lookup, nft_range and so on. But these basic expressions' init
routine is a little ugly, too many goto errX labels, and we forget
to call nft_range_module_exit in the exit routine, although it is
harmless.

Acctually, the init and exit routines of these basic expressions
are same, i.e. do nft_register_expr in the init routine and do
nft_unregister_expr in the exit routine.

So it's better to arrange them into an array and deal with them
together.

Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables_core.h
net/netfilter/nf_tables_core.c
net/netfilter/nft_bitwise.c
net/netfilter/nft_byteorder.c
net/netfilter/nft_cmp.c
net/netfilter/nft_dynset.c
net/netfilter/nft_immediate.c
net/netfilter/nft_lookup.c
net/netfilter/nft_payload.c
net/netfilter/nft_range.c