]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/pppox.c
arm ide breakage
[linux-2.6-omap-h63xx.git] / drivers / net / pppox.c
index f3e47d0c2b3ce2cb253d96844e33ffb8b03b2552..03aecc97fb453d32eefb596dddba3f6286d909df 100644 (file)
@@ -73,7 +73,7 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
        struct sock *sk = sock->sk;
        struct pppox_sock *po = pppox_sk(sk);
-       int rc = 0;
+       int rc;
 
        lock_sock(sk);
 
@@ -94,12 +94,9 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                break;
        }
        default:
-               if (pppox_protos[sk->sk_protocol]->ioctl)
-                       rc = pppox_protos[sk->sk_protocol]->ioctl(sock, cmd,
-                                                                 arg);
-
-               break;
-       };
+               rc = pppox_protos[sk->sk_protocol]->ioctl ?
+                       pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, arg) : -ENOTTY;
+       }
 
        release_sock(sk);
        return rc;
@@ -107,26 +104,24 @@ 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;
 
        rc = -EPROTONOSUPPORT;
-#ifdef CONFIG_KMOD
-       if (!pppox_protos[protocol]) {
-               char buffer[32];
-               sprintf(buffer, "pppox-proto-%d", protocol);
-               request_module(buffer);
-       }
-#endif
+       if (!pppox_protos[protocol])
+               request_module("pppox-proto-%d", protocol);
        if (!pppox_protos[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: