patch-2.3.15 linux/net/netlink/netlink_dev.c

Next file: linux/net/netrom/af_netrom.c
Previous file: linux/net/netlink/af_netlink.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.14/linux/net/netlink/netlink_dev.c linux/net/netlink/netlink_dev.c
@@ -106,7 +106,7 @@
 	struct socket *sock;
 	struct sockaddr_nl nladdr;
 	int err;
-	
+
 	if (minor>=MAX_LINKS)
 		return -ENODEV;
 	if (open_map&(1<<minor))
@@ -114,22 +114,10 @@
 
 	open_map |= (1<<minor);
 	MOD_INC_USE_COUNT;
-	
-	err = -EINVAL;
-	if (net_families[PF_NETLINK]==NULL)
-  		goto out;
-
-	err = -ENFILE;
-	if (!(sock = sock_alloc())) 
-		goto out;
-
-	sock->type = SOCK_RAW;
 
-	if ((err = net_families[PF_NETLINK]->create(sock, minor)) < 0) 
-	{
-		sock_release(sock);
+	err = sock_create(PF_NETLINK, SOCK_RAW, minor, &sock);
+	if (err < 0)
 		goto out;
-	}
 
 	memset(&nladdr, 0, sizeof(nladdr));
 	nladdr.nl_family = AF_NETLINK;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)