提交 0e0d5002 编写于 作者: P Pablo Neira Ayuso

netfilter: nf_tables: use the right index from flowtable error path

Use the right loop index, not the number of devices in the array that we
need to remove, the following message uncovered the problem:

[ 5437.044119] hook not found, pf 5 num 0
[ 5437.044140] WARNING: CPU: 2 PID: 24983 at net/netfilter/core.c:376 __nf_unregister_net_hook+0x250/0x280
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 e603ea4b
...@@ -5136,7 +5136,7 @@ static int nf_tables_newflowtable(struct net *net, struct sock *nlsk, ...@@ -5136,7 +5136,7 @@ static int nf_tables_newflowtable(struct net *net, struct sock *nlsk,
i = flowtable->ops_len; i = flowtable->ops_len;
err4: err4:
for (k = i - 1; k >= 0; k--) for (k = i - 1; k >= 0; k--)
nf_unregister_net_hook(net, &flowtable->ops[i]); nf_unregister_net_hook(net, &flowtable->ops[k]);
kfree(flowtable->ops); kfree(flowtable->ops);
err3: err3:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册