]> err.no Git - linux-2.6/blobdiff - net/ipv4/af_inet.c
[MAC80211]: remove turbo modes
[linux-2.6] / net / ipv4 / af_inet.c
index e68103475cca2a76a349d270d1db72c62132b4c7..110a19edacc817779b112bbdef45e71e6a9e25dd 100644 (file)
@@ -241,7 +241,7 @@ EXPORT_SYMBOL(build_ehash_secret);
  *     Create an inet socket.
  */
 
-static int inet_create(struct socket *sock, int protocol)
+static int inet_create(struct net *net, struct socket *sock, int protocol)
 {
        struct sock *sk;
        struct list_head *p;
@@ -253,6 +253,9 @@ static int inet_create(struct socket *sock, int protocol)
        int try_loading_module = 0;
        int err;
 
+       if (net != &init_net)
+               return -EAFNOSUPPORT;
+
        if (sock->type != SOCK_RAW &&
            sock->type != SOCK_DGRAM &&
            !inet_ehash_secret)
@@ -320,7 +323,7 @@ lookup_protocol:
        BUG_TRAP(answer_prot->slab != NULL);
 
        err = -ENOBUFS;
-       sk = sk_alloc(PF_INET, GFP_KERNEL, answer_prot, 1);
+       sk = sk_alloc(net, PF_INET, GFP_KERNEL, answer_prot, 1);
        if (sk == NULL)
                goto out;