kernel: generic: Fix nftables inet table breakage
[openwrt/openwrt.git] / target / linux / generic / backport-4.14 / 298-v4.16-netfilter-core-add-nf_remove_net_hook.patch
1 From 3d3cdc38e8c265a9f9d3825e823e772872bca1b8 Mon Sep 17 00:00:00 2001
2 From: Pablo Neira Ayuso <pablo@netfilter.org>
3 Date: Sat, 9 Dec 2017 15:19:14 +0100
4 Subject: [PATCH 01/11] netfilter: core: add nf_remove_net_hook
5
6 Just a cleanup, __nf_unregister_net_hook() is used by a follow up patch
7 when handling NFPROTO_INET as a real family from the core.
8
9 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
10 ---
11 net/netfilter/core.c | 8 ++++----
12 1 file changed, 4 insertions(+), 4 deletions(-)
13
14 --- a/net/netfilter/core.c
15 +++ b/net/netfilter/core.c
16 @@ -356,7 +356,7 @@ int nf_register_net_hook(struct net *net
17 EXPORT_SYMBOL(nf_register_net_hook);
18
19 /*
20 - * __nf_unregister_net_hook - remove a hook from blob
21 + * nf_remove_net_hook - remove a hook from blob
22 *
23 * @oldp: current address of hook blob
24 * @unreg: hook to unregister
25 @@ -364,8 +364,8 @@ EXPORT_SYMBOL(nf_register_net_hook);
26 * This cannot fail, hook unregistration must always succeed.
27 * Therefore replace the to-be-removed hook with a dummy hook.
28 */
29 -static void __nf_unregister_net_hook(struct nf_hook_entries *old,
30 - const struct nf_hook_ops *unreg)
31 +static void nf_remove_net_hook(struct nf_hook_entries *old,
32 + const struct nf_hook_ops *unreg)
33 {
34 struct nf_hook_ops **orig_ops;
35 bool found = false;
36 @@ -411,7 +411,7 @@ void nf_unregister_net_hook(struct net *
37 return;
38 }
39
40 - __nf_unregister_net_hook(p, reg);
41 + nf_remove_net_hook(p, reg);
42
43 p = __nf_hook_entries_try_shrink(pp);
44 mutex_unlock(&nf_hook_mutex);