]> git.neil.brown.name Git - history.git/commitdiff
o af_key: use revised net module infrastructure
authorArnaldo Carvalho de Melo <acme@conectiva.com.br>
Sat, 3 May 2003 00:20:22 +0000 (21:20 -0300)
committerArnaldo Carvalho de Melo <acme@conectiva.com.br>
Sat, 3 May 2003 00:20:22 +0000 (21:20 -0300)
Using sk_set_owner and having THIS_MODULE in the struct proto_ops registered
with the core.

net/key/af_key.c

index 3292da01510fda38ccef9edf678850a55366b2f6..b91167dd30e4412c5750e7637924cb5b03798984 100644 (file)
@@ -152,9 +152,10 @@ static int pfkey_create(struct socket *sock, int protocol)
        sk = sk_alloc(PF_KEY, GFP_KERNEL, 1, NULL);
        if (sk == NULL)
                goto out;
-
+       
        sock->ops = &pfkey_ops;
        sock_init_data(sock, sk);
+       sk_set_owner(sk, THIS_MODULE);
 
        err = -ENOMEM;
        pfk = pfkey_sk(sk) = kmalloc(sizeof(*pfk), GFP_KERNEL);
@@ -2761,7 +2762,7 @@ out:
 
 static struct proto_ops pfkey_ops = {
        .family         =       PF_KEY,
-
+       .owner          =       THIS_MODULE,
        /* Operations that make no sense on pfkey sockets. */
        .bind           =       sock_no_bind,
        .connect        =       sock_no_connect,