]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/sctp/protocol.c
[NETNS]: Inet control socket should not hold a namespace.
[net-next-2.6.git] / net / sctp / protocol.c
index ac0833c19450d80d18cdab74fd35aae88a9dec2c..067c8a1658d6fbf0872129baeb07ba0f0d7656d6 100644 (file)
@@ -674,21 +674,19 @@ static int sctp_ctl_sock_init(void)
 {
        int err;
        sa_family_t family;
-       struct socket *socket;
 
        if (sctp_get_pf_specific(PF_INET6))
                family = PF_INET6;
        else
                family = PF_INET;
 
-       err = inet_ctl_sock_create(&socket, family,
-                                  SOCK_SEQPACKET, IPPROTO_SCTP);
+       err = inet_ctl_sock_create(&sctp_ctl_sock, family,
+                                  SOCK_SEQPACKET, IPPROTO_SCTP, &init_net);
        if (err < 0) {
                printk(KERN_ERR
                       "SCTP: Failed to create the SCTP control socket.\n");
                return err;
        }
-       sctp_ctl_sock = socket->sk;
        return 0;
 }
 
@@ -1286,7 +1284,7 @@ err_v6_add_protocol:
        sctp_v6_del_protocol();
 err_add_protocol:
        sctp_v4_del_protocol();
-       sock_release(sctp_ctl_sock->sk_socket);
+       inet_ctl_sock_destroy(sctp_ctl_sock);
 err_ctl_sock_init:
        sctp_v6_protosw_exit();
 err_v6_protosw_init:
@@ -1330,7 +1328,7 @@ SCTP_STATIC __exit void sctp_exit(void)
        sctp_v4_del_protocol();
 
        /* Free the control endpoint.  */
-       sock_release(sctp_ctl_sock->sk_socket);
+       inet_ctl_sock_destroy(sctp_ctl_sock);
 
        /* Free protosw registrations */
        sctp_v6_protosw_exit();