o ipv4: use revised net module infrastructure

Using sk_set_owner and having THIS_MODULE in the struct proto_ops
registered with the core. The sk_set_owner cases are in the callers
of tp->af_specific->syn_recv_sock so as to not have spurious extra
sk_set_owner calls in the ipv6 code that reuses ipv4 code.
parent 49bd36c7
......@@ -390,6 +390,7 @@ static int inet_create(struct socket *sock, int protocol)
inet->id = 0;
sock_init_data(sock, sk);
sk_set_owner(sk, THIS_MODULE);
sk->destruct = inet_sock_destruct;
sk->zapped = 0;
......@@ -882,7 +883,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
struct proto_ops inet_stream_ops = {
.family = PF_INET,
.owner = THIS_MODULE,
.release = inet_release,
.bind = inet_bind,
.connect = inet_stream_connect,
......@@ -903,7 +904,7 @@ struct proto_ops inet_stream_ops = {
struct proto_ops inet_dgram_ops = {
.family = PF_INET,
.owner = THIS_MODULE,
.release = inet_release,
.bind = inet_bind,
.connect = inet_dgram_connect,
......
......@@ -101,9 +101,10 @@ static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb,
struct sock *child;
child = tp->af_specific->syn_recv_sock(sk, skb, req, dst);
if (child)
if (child) {
sk_set_owner(child, sk->owner);
tcp_acceptq_queue(sk, req, child);
else
} else
tcp_openreq_free(req);
return child;
......
......@@ -967,6 +967,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
if (child == NULL)
goto listen_overflow;
sk_set_owner(child, sk->owner);
tcp_synq_unlink(tp, req, prev);
tcp_synq_removed(sk, req);
......
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