]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netrom/af_netrom.c
hwmon: (atxp1) Convert to a new-style i2c driver
[linux-2.6-omap-h63xx.git] / net / netrom / af_netrom.c
index 15c8a92bd7193bc6d19d386fadeb6a23815f2c51..4bae8b998cab8fa27325021ca1c4fc7e7ff3b40e 100644 (file)
@@ -106,6 +106,9 @@ static int nr_device_event(struct notifier_block *this, unsigned long event, voi
 {
        struct net_device *dev = (struct net_device *)ptr;
 
+       if (dev_net(dev) != &init_net)
+               return NOTIFY_DONE;
+
        if (event != NETDEV_DOWN)
                return NOTIFY_DONE;
 
@@ -409,15 +412,19 @@ static struct proto nr_proto = {
        .obj_size = sizeof(struct nr_sock),
 };
 
-static int nr_create(struct socket *sock, int protocol)
+static int nr_create(struct net *net, struct socket *sock, int protocol)
 {
        struct sock *sk;
        struct nr_sock *nr;
 
+       if (net != &init_net)
+               return -EAFNOSUPPORT;
+
        if (sock->type != SOCK_SEQPACKET || protocol != 0)
                return -ESOCKTNOSUPPORT;
 
-       if ((sk = sk_alloc(PF_NETROM, GFP_ATOMIC, &nr_proto, 1)) == NULL)
+       sk = sk_alloc(net, PF_NETROM, GFP_ATOMIC, &nr_proto);
+       if (sk  == NULL)
                return -ENOMEM;
 
        nr = nr_sk(sk);
@@ -459,7 +466,8 @@ static struct sock *nr_make_new(struct sock *osk)
        if (osk->sk_type != SOCK_SEQPACKET)
                return NULL;
 
-       if ((sk = sk_alloc(PF_NETROM, GFP_ATOMIC, osk->sk_prot, 1)) == NULL)
+       sk = sk_alloc(sock_net(osk), PF_NETROM, GFP_ATOMIC, osk->sk_prot);
+       if (sk == NULL)
                return NULL;
 
        nr = nr_sk(sk);