提交 a0142733 编写于 作者: P Pablo Neira Ayuso 提交者: Patrick McHardy

netfilter: nfnetlink: return ENOMEM if we fail to create netlink socket

With this patch, nfnetlink returns -ENOMEM instead of -EPERM if we
fail to create the nfnetlink netlink socket during the module
loading. This is exactly what rtnetlink does in this case.

Ideally, it would be better if we propagate the error that has
happened in netlink_kernel_create(), however, this function still
does not implement this yet.
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NPatrick McHardy <kaber@trash.net>
上级 150ace0d
...@@ -203,7 +203,7 @@ static int __init nfnetlink_init(void) ...@@ -203,7 +203,7 @@ static int __init nfnetlink_init(void)
nfnetlink_rcv, NULL, THIS_MODULE); nfnetlink_rcv, NULL, THIS_MODULE);
if (!nfnl) { if (!nfnl) {
printk(KERN_ERR "cannot initialize nfnetlink!\n"); printk(KERN_ERR "cannot initialize nfnetlink!\n");
return -1; return -ENOMEM;
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册