]> git.neil.brown.name Git - history.git/commitdiff
o ipv4: use revised net module infrastructure
authorArnaldo Carvalho de Melo <acme@conectiva.com.br>
Sat, 3 May 2003 00:43:10 +0000 (21:43 -0300)
committerArnaldo Carvalho de Melo <acme@conectiva.com.br>
Sat, 3 May 2003 00:43:10 +0000 (21:43 -0300)
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.

net/ipv4/af_inet.c
net/ipv4/syncookies.c
net/ipv4/tcp_minisocks.c

index 390c24c2a45be009bc1e1133a07a480433fcd90d..eb97374a3d855c78c179b62afc3e54edb64057e3 100644 (file)
@@ -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,
index ae6ac63877b335a8d0e636b3cadc4185ccaad1c6..2047c3d31c9bf93c7a8de314706c4608114a5a31 100644 (file)
@@ -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;
index da1f688c06a46dde67316a3e5a71c819ef2da5c3..1bf1edc09f64619a82f277205e7d64f19935d0c2 100644 (file)
@@ -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);