diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2005-12-27 23:57:40 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 16:11:23 -0500 |
commit | 17ba15fb6264f27374bc87f4c3f8519b80289d85 (patch) | |
tree | 3134abef98d88aa029aa7faa72d8a41686644e99 | |
parent | 8639a11e23d9eb0a6ceac2feed27acdfbb158f95 (diff) |
[PPPOX]: Fix assignment into const proto_ops.
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>
-rw-r--r-- | drivers/net/pppoe.c | 9 | ||||
-rw-r--r-- | drivers/net/pppox.c | 10 | ||||
-rw-r--r-- | include/linux/if_pppox.h | 3 |
3 files changed, 8 insertions, 14 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 71e303b28646..9369f811075d 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -85,7 +85,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
85 | static int pppoe_xmit(struct ppp_channel *chan, struct sk_buff *skb); | 85 | static int pppoe_xmit(struct ppp_channel *chan, struct sk_buff *skb); |
86 | static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb); | 86 | static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb); |
87 | 87 | ||
88 | static struct proto_ops pppoe_ops; | 88 | static const struct proto_ops pppoe_ops; |
89 | static DEFINE_RWLOCK(pppoe_hash_lock); | 89 | static DEFINE_RWLOCK(pppoe_hash_lock); |
90 | 90 | ||
91 | static struct ppp_channel_ops pppoe_chan_ops; | 91 | static struct ppp_channel_ops pppoe_chan_ops; |
@@ -1063,9 +1063,7 @@ static int __init pppoe_proc_init(void) | |||
1063 | static inline int pppoe_proc_init(void) { return 0; } | 1063 | static inline int pppoe_proc_init(void) { return 0; } |
1064 | #endif /* CONFIG_PROC_FS */ | 1064 | #endif /* CONFIG_PROC_FS */ |
1065 | 1065 | ||
1066 | /* ->ioctl are set at pppox_create */ | 1066 | static const struct proto_ops pppoe_ops = { |
1067 | |||
1068 | static struct proto_ops pppoe_ops = { | ||
1069 | .family = AF_PPPOX, | 1067 | .family = AF_PPPOX, |
1070 | .owner = THIS_MODULE, | 1068 | .owner = THIS_MODULE, |
1071 | .release = pppoe_release, | 1069 | .release = pppoe_release, |
@@ -1081,7 +1079,8 @@ static struct proto_ops pppoe_ops = { | |||
1081 | .getsockopt = sock_no_getsockopt, | 1079 | .getsockopt = sock_no_getsockopt, |
1082 | .sendmsg = pppoe_sendmsg, | 1080 | .sendmsg = pppoe_sendmsg, |
1083 | .recvmsg = pppoe_recvmsg, | 1081 | .recvmsg = pppoe_recvmsg, |
1084 | .mmap = sock_no_mmap | 1082 | .mmap = sock_no_mmap, |
1083 | .ioctl = pppox_ioctl, | ||
1085 | }; | 1084 | }; |
1086 | 1085 | ||
1087 | static struct pppox_proto pppoe_proto = { | 1086 | static struct pppox_proto pppoe_proto = { |
diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c index 0c1e114527fb..9315046b3f55 100644 --- a/drivers/net/pppox.c +++ b/drivers/net/pppox.c | |||
@@ -68,8 +68,7 @@ EXPORT_SYMBOL(register_pppox_proto); | |||
68 | EXPORT_SYMBOL(unregister_pppox_proto); | 68 | EXPORT_SYMBOL(unregister_pppox_proto); |
69 | EXPORT_SYMBOL(pppox_unbind_sock); | 69 | EXPORT_SYMBOL(pppox_unbind_sock); |
70 | 70 | ||
71 | static int pppox_ioctl(struct socket* sock, unsigned int cmd, | 71 | int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
72 | unsigned long arg) | ||
73 | { | 72 | { |
74 | struct sock *sk = sock->sk; | 73 | struct sock *sk = sock->sk; |
75 | struct pppox_sock *po = pppox_sk(sk); | 74 | struct pppox_sock *po = pppox_sk(sk); |
@@ -105,6 +104,7 @@ static int pppox_ioctl(struct socket* sock, unsigned int cmd, | |||
105 | return rc; | 104 | return rc; |
106 | } | 105 | } |
107 | 106 | ||
107 | EXPORT_SYMBOL(pppox_ioctl); | ||
108 | 108 | ||
109 | static int pppox_create(struct socket *sock, int protocol) | 109 | static int pppox_create(struct socket *sock, int protocol) |
110 | { | 110 | { |
@@ -119,11 +119,7 @@ static int pppox_create(struct socket *sock, int protocol) | |||
119 | goto out; | 119 | goto out; |
120 | 120 | ||
121 | rc = pppox_protos[protocol]->create(sock); | 121 | rc = pppox_protos[protocol]->create(sock); |
122 | if (!rc) { | 122 | |
123 | /* We get to set the ioctl handler. */ | ||
124 | /* For everything else, pppox is just a shell. */ | ||
125 | sock->ops->ioctl = pppox_ioctl; | ||
126 | } | ||
127 | module_put(pppox_protos[protocol]->owner); | 123 | module_put(pppox_protos[protocol]->owner); |
128 | out: | 124 | out: |
129 | return rc; | 125 | return rc; |
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index e677f73f13dd..4fab3d0a4bce 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h | |||
@@ -157,8 +157,7 @@ struct pppox_proto { | |||
157 | extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); | 157 | extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); |
158 | extern void unregister_pppox_proto(int proto_num); | 158 | extern void unregister_pppox_proto(int proto_num); |
159 | extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ | 159 | extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ |
160 | extern int pppox_channel_ioctl(struct ppp_channel *pc, unsigned int cmd, | 160 | extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
161 | unsigned long arg); | ||
162 | 161 | ||
163 | /* PPPoX socket states */ | 162 | /* PPPoX socket states */ |
164 | enum { | 163 | enum { |