patch-2.1.53 linux/net/ax25/af_ax25.c

Next file: linux/net/core/dev.c
Previous file: linux/net/appletalk/ddp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.52/linux/net/ax25/af_ax25.c linux/net/ax25/af_ax25.c
@@ -828,7 +828,7 @@
 			return -ESOCKTNOSUPPORT;
 	}
 
-	if ((sk = sk_alloc(GFP_ATOMIC)) == NULL)
+	if ((sk = sk_alloc(AF_AX25, GFP_ATOMIC)) == NULL)
 		return -ENOMEM;
 
 	if ((ax25 = ax25_create_cb()) == NULL) {
@@ -854,7 +854,7 @@
 	struct sock *sk;
 	ax25_cb *ax25;
 
-	if ((sk = sk_alloc(GFP_ATOMIC)) == NULL)
+	if ((sk = sk_alloc(AF_AX25, GFP_ATOMIC)) == NULL)
 		return NULL;
 
 	if ((ax25 = ax25_create_cb()) == NULL) {
@@ -919,16 +919,6 @@
 	return sk;
 }
 
-static int ax25_dup(struct socket *newsock, struct socket *oldsock)
-{
-	struct sock *sk = oldsock->sk;
-
-	if (sk == NULL || newsock == NULL)
-		return -EINVAL;
-
-	return ax25_create(newsock, sk->protocol);
-}
-
 static int ax25_release(struct socket *sock, struct socket *peer)
 {
 	struct sock *sk = sock->sk;
@@ -1204,10 +1194,6 @@
 	return 0;
 }
 
-static int ax25_socketpair(struct socket *sock1, struct socket *sock2)
-{
-	return -EOPNOTSUPP;
-}
 
 static int ax25_accept(struct socket *sock, struct socket *newsock, int flags)
 {
@@ -1707,11 +1693,11 @@
 static struct proto_ops ax25_proto_ops = {
 	AF_AX25,
 
-	ax25_dup,
+	sock_no_dup,
 	ax25_release,
 	ax25_bind,
 	ax25_connect,
-	ax25_socketpair,
+	sock_no_socketpair,
 	ax25_accept,
 	ax25_getname,
 	datagram_poll,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov