Browse Source

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: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Pablo Neira Ayuso 16 năm trước cách đây
mục cha
commit
a0142733a7
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      net/netfilter/nfnetlink.c

+ 1 - 1
net/netfilter/nfnetlink.c

@@ -203,7 +203,7 @@ static int __init nfnetlink_init(void)
 				     nfnetlink_rcv, NULL, THIS_MODULE);
 	if (!nfnl) {
 		printk(KERN_ERR "cannot initialize nfnetlink!\n");
-		return -1;
+		return -ENOMEM;
 	}
 
 	return 0;