diff options
| author | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2003-05-02 21:43:10 -0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 2003-05-02 21:43:10 -0300 |
| commit | 8b97999a03d5b79c190be3b33859fa1d4bdab22d (patch) | |
| tree | df17d82768e6f2f845199fca8e86ce07f3739e36 | |
| parent | 49bd36c74bed43c298e04d481df902a8f77756e8 (diff) | |
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.
| -rw-r--r-- | net/ipv4/af_inet.c | 5 | ||||
| -rw-r--r-- | net/ipv4/syncookies.c | 5 | ||||
| -rw-r--r-- | net/ipv4/tcp_minisocks.c | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 390c24c2a45b..eb97374a3d85 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -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, diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index ae6ac63877b3..2047c3d31c9b 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c @@ -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; diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index da1f688c06a4..1bf1edc09f64 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -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); |
