o sctp: use revised net module infrastructure

Using sk_set_owner and having THIS_MODULE in the struct proto_ops registered
with the core.
parent 0109f7bc
...@@ -508,6 +508,7 @@ struct sock *sctp_v6_create_accept_sk(struct sock *sk, ...@@ -508,6 +508,7 @@ struct sock *sctp_v6_create_accept_sk(struct sock *sk,
goto out; goto out;
sock_init_data(NULL, newsk); sock_init_data(NULL, newsk);
sk_set_owner(newsk, THIS_MODULE);
newsk->type = SOCK_STREAM; newsk->type = SOCK_STREAM;
...@@ -749,6 +750,7 @@ static int sctp_inet6_supported_addrs(const struct sctp_opt *opt, ...@@ -749,6 +750,7 @@ static int sctp_inet6_supported_addrs(const struct sctp_opt *opt,
static struct proto_ops inet6_seqpacket_ops = { static struct proto_ops inet6_seqpacket_ops = {
.family = PF_INET6, .family = PF_INET6,
.owner = THIS_MODULE,
.release = inet6_release, .release = inet6_release,
.bind = inet6_bind, .bind = inet6_bind,
.connect = inet_dgram_connect, .connect = inet_dgram_connect,
......
...@@ -499,6 +499,7 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk, ...@@ -499,6 +499,7 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk,
goto out; goto out;
sock_init_data(NULL, newsk); sock_init_data(NULL, newsk);
sk_set_owner(newsk, THIS_MODULE);
newsk->type = SOCK_STREAM; newsk->type = SOCK_STREAM;
...@@ -748,6 +749,7 @@ struct notifier_block sctp_inetaddr_notifier = { ...@@ -748,6 +749,7 @@ struct notifier_block sctp_inetaddr_notifier = {
/* Socket operations. */ /* Socket operations. */
struct proto_ops inet_seqpacket_ops = { struct proto_ops inet_seqpacket_ops = {
.family = PF_INET, .family = PF_INET,
.owner = THIS_MODULE,
.release = inet_release, /* Needs to be wrapped... */ .release = inet_release, /* Needs to be wrapped... */
.bind = inet_bind, .bind = inet_bind,
.connect = inet_dgram_connect, .connect = inet_dgram_connect,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment