]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/pppox.c
[NET]: Make socket creation namespace safe.
[net-next-2.6.git] / drivers / net / pppox.c
index 25c52b55c38fb6cb11ddc369ce88f5b527f7cf20..c6898c1fc54d95de595fa990fc7b0977149c796a 100644 (file)
@@ -104,10 +104,13 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 
 EXPORT_SYMBOL(pppox_ioctl);
 
-static int pppox_create(struct socket *sock, int protocol)
+static int pppox_create(struct net *net, struct socket *sock, int protocol)
 {
        int rc = -EPROTOTYPE;
 
+       if (net != &init_net)
+               return -EAFNOSUPPORT;
+
        if (protocol < 0 || protocol > PX_MAX_PROTO)
                goto out;
 
@@ -123,7 +126,7 @@ static int pppox_create(struct socket *sock, int protocol)
            !try_module_get(pppox_protos[protocol]->owner))
                goto out;
 
-       rc = pppox_protos[protocol]->create(sock);
+       rc = pppox_protos[protocol]->create(net, sock);
 
        module_put(pppox_protos[protocol]->owner);
 out: