* the Out-of-the-blue (OOTB) packets. A control sock will be created
* for this socket at the initialization time.
*/
-static struct socket *sctp_ctl_socket;
+static struct sock *sctp_ctl_sock;
static struct sctp_pf *sctp_pf_inet6_specific;
static struct sctp_pf *sctp_pf_inet_specific;
/* Return the address of the control sock. */
struct sock *sctp_get_ctl_sock(void)
{
- return sctp_ctl_socket->sk;
+ return sctp_ctl_sock;
}
/* Set up the proc fs entry for the SCTP protocol. */
{
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(&sctp_ctl_socket, family,
+ err = inet_ctl_sock_create(&socket, family,
SOCK_SEQPACKET, IPPROTO_SCTP);
if (err < 0) {
printk(KERN_ERR
"SCTP: Failed to create the SCTP control socket.\n");
return err;
}
+ sctp_ctl_sock = socket->sk;
return 0;
}
sctp_v6_del_protocol();
err_add_protocol:
sctp_v4_del_protocol();
- sock_release(sctp_ctl_socket);
+ sock_release(sctp_ctl_sock->sk_socket);
err_ctl_sock_init:
sctp_v6_protosw_exit();
err_v6_protosw_init:
sctp_v4_del_protocol();
/* Free the control endpoint. */
- sock_release(sctp_ctl_socket);
+ sock_release(sctp_ctl_sock->sk_socket);
/* Free protosw registrations */
sctp_v6_protosw_exit();