aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/af_decnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet/af_decnet.c')
-rw-r--r--net/decnet/af_decnet.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 625d5955b8e2..aca4c4930eb6 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -471,10 +471,10 @@ static struct proto dn_proto = {
471 .obj_size = sizeof(struct dn_sock), 471 .obj_size = sizeof(struct dn_sock),
472}; 472};
473 473
474static struct sock *dn_alloc_sock(struct socket *sock, gfp_t gfp) 474static struct sock *dn_alloc_sock(struct net *net, struct socket *sock, gfp_t gfp)
475{ 475{
476 struct dn_scp *scp; 476 struct dn_scp *scp;
477 struct sock *sk = sk_alloc(PF_DECnet, gfp, &dn_proto, 1); 477 struct sock *sk = sk_alloc(net, PF_DECnet, gfp, &dn_proto, 1);
478 478
479 if (!sk) 479 if (!sk)
480 goto out; 480 goto out;
@@ -675,10 +675,13 @@ char *dn_addr2asc(__u16 addr, char *buf)
675 675
676 676
677 677
678static int dn_create(struct socket *sock, int protocol) 678static int dn_create(struct net *net, struct socket *sock, int protocol)
679{ 679{
680 struct sock *sk; 680 struct sock *sk;
681 681
682 if (net != &init_net)
683 return -EAFNOSUPPORT;
684
682 switch(sock->type) { 685 switch(sock->type) {
683 case SOCK_SEQPACKET: 686 case SOCK_SEQPACKET:
684 if (protocol != DNPROTO_NSP) 687 if (protocol != DNPROTO_NSP)
@@ -691,7 +694,7 @@ static int dn_create(struct socket *sock, int protocol)
691 } 694 }
692 695
693 696
694 if ((sk = dn_alloc_sock(sock, GFP_KERNEL)) == NULL) 697 if ((sk = dn_alloc_sock(net, sock, GFP_KERNEL)) == NULL)
695 return -ENOBUFS; 698 return -ENOBUFS;
696 699
697 sk->sk_protocol = protocol; 700 sk->sk_protocol = protocol;
@@ -1091,7 +1094,7 @@ static int dn_accept(struct socket *sock, struct socket *newsock, int flags)
1091 1094
1092 cb = DN_SKB_CB(skb); 1095 cb = DN_SKB_CB(skb);
1093 sk->sk_ack_backlog--; 1096 sk->sk_ack_backlog--;
1094 newsk = dn_alloc_sock(newsock, sk->sk_allocation); 1097 newsk = dn_alloc_sock(sk->sk_net, newsock, sk->sk_allocation);
1095 if (newsk == NULL) { 1098 if (newsk == NULL) {
1096 release_sock(sk); 1099 release_sock(sk);
1097 kfree_skb(skb); 1100 kfree_skb(skb);