]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PPPOX]: Fix assignment into const proto_ops.
authorDavid S. Miller <davem@sunset.davemloft.net>
Wed, 28 Dec 2005 04:57:40 +0000 (20:57 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Tue, 3 Jan 2006 21:11:23 +0000 (13:11 -0800)
And actually, with this, the whole pppox layer can basically
be removed and subsumed into pppoe.c, no other pppox sub-protocol
implementation exists and we've had this thing for at least 4
years.

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pppoe.c
drivers/net/pppox.c
include/linux/if_pppox.h

index 71e303b286461a70e927ab31250f635fc6469aea..9369f811075d123f245dc54bfac2a86f56607225 100644 (file)
@@ -85,7 +85,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 static int pppoe_xmit(struct ppp_channel *chan, struct sk_buff *skb);
 static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb);
 
-static struct proto_ops pppoe_ops;
+static const struct proto_ops pppoe_ops;
 static DEFINE_RWLOCK(pppoe_hash_lock);
 
 static struct ppp_channel_ops pppoe_chan_ops;
@@ -1063,9 +1063,7 @@ static int __init pppoe_proc_init(void)
 static inline int pppoe_proc_init(void) { return 0; }
 #endif /* CONFIG_PROC_FS */
 
-/* ->ioctl are set at pppox_create */
-
-static struct proto_ops pppoe_ops = {
+static const struct proto_ops pppoe_ops = {
     .family            = AF_PPPOX,
     .owner             = THIS_MODULE,
     .release           = pppoe_release,
@@ -1081,7 +1079,8 @@ static struct proto_ops pppoe_ops = {
     .getsockopt                = sock_no_getsockopt,
     .sendmsg           = pppoe_sendmsg,
     .recvmsg           = pppoe_recvmsg,
-    .mmap              = sock_no_mmap
+    .mmap              = sock_no_mmap,
+    .ioctl             = pppox_ioctl,
 };
 
 static struct pppox_proto pppoe_proto = {
index 0c1e114527fb3549feb59685ac57d41b77502529..9315046b3f5509eebea0b0207f9b36a4a4326c89 100644 (file)
@@ -68,8 +68,7 @@ EXPORT_SYMBOL(register_pppox_proto);
 EXPORT_SYMBOL(unregister_pppox_proto);
 EXPORT_SYMBOL(pppox_unbind_sock);
 
-static int pppox_ioctl(struct socket* sock, unsigned int cmd, 
-                      unsigned long arg)
+int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
        struct sock *sk = sock->sk;
        struct pppox_sock *po = pppox_sk(sk);
@@ -105,6 +104,7 @@ static int pppox_ioctl(struct socket* sock, unsigned int cmd,
        return rc;
 }
 
+EXPORT_SYMBOL(pppox_ioctl);
 
 static int pppox_create(struct socket *sock, int protocol)
 {
@@ -119,11 +119,7 @@ static int pppox_create(struct socket *sock, int protocol)
                goto out;
 
        rc = pppox_protos[protocol]->create(sock);
-       if (!rc) {
-               /* We get to set the ioctl handler. */
-               /* For everything else, pppox is just a shell. */
-               sock->ops->ioctl = pppox_ioctl;
-       }
+
        module_put(pppox_protos[protocol]->owner);
 out:
        return rc;
index e677f73f13dd7f5a6db8455152c7f90faabf8f50..4fab3d0a4bcef5e7d6e0c9047b30b09afdead916 100644 (file)
@@ -157,8 +157,7 @@ struct pppox_proto {
 extern int register_pppox_proto(int proto_num, struct pppox_proto *pp);
 extern void unregister_pppox_proto(int proto_num);
 extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
-extern int pppox_channel_ioctl(struct ppp_channel *pc, unsigned int cmd,
-                              unsigned long arg);
+extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
 
 /* PPPoX socket states */
 enum {