Commit 8258175c authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller

[SCTP]: Replace socket with sock for SCTP control socket.

Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Acked-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4ffe0225
...@@ -74,7 +74,7 @@ DEFINE_SPINLOCK(sctp_assocs_id_lock); ...@@ -74,7 +74,7 @@ DEFINE_SPINLOCK(sctp_assocs_id_lock);
* the Out-of-the-blue (OOTB) packets. A control sock will be created * the Out-of-the-blue (OOTB) packets. A control sock will be created
* for this socket at the initialization time. * 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_inet6_specific;
static struct sctp_pf *sctp_pf_inet_specific; static struct sctp_pf *sctp_pf_inet_specific;
...@@ -91,7 +91,7 @@ int sysctl_sctp_wmem[3]; ...@@ -91,7 +91,7 @@ int sysctl_sctp_wmem[3];
/* Return the address of the control sock. */ /* Return the address of the control sock. */
struct sock *sctp_get_ctl_sock(void) 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. */ /* Set up the proc fs entry for the SCTP protocol. */
...@@ -674,19 +674,21 @@ static int sctp_ctl_sock_init(void) ...@@ -674,19 +674,21 @@ static int sctp_ctl_sock_init(void)
{ {
int err; int err;
sa_family_t family; sa_family_t family;
struct socket *socket;
if (sctp_get_pf_specific(PF_INET6)) if (sctp_get_pf_specific(PF_INET6))
family = PF_INET6; family = PF_INET6;
else else
family = PF_INET; family = PF_INET;
err = inet_ctl_sock_create(&sctp_ctl_socket, family, err = inet_ctl_sock_create(&socket, family,
SOCK_SEQPACKET, IPPROTO_SCTP); SOCK_SEQPACKET, IPPROTO_SCTP);
if (err < 0) { if (err < 0) {
printk(KERN_ERR printk(KERN_ERR
"SCTP: Failed to create the SCTP control socket.\n"); "SCTP: Failed to create the SCTP control socket.\n");
return err; return err;
} }
sctp_ctl_sock = socket->sk;
return 0; return 0;
} }
...@@ -1284,7 +1286,7 @@ err_v6_add_protocol: ...@@ -1284,7 +1286,7 @@ err_v6_add_protocol:
sctp_v6_del_protocol(); sctp_v6_del_protocol();
err_add_protocol: err_add_protocol:
sctp_v4_del_protocol(); sctp_v4_del_protocol();
sock_release(sctp_ctl_socket); sock_release(sctp_ctl_sock->sk_socket);
err_ctl_sock_init: err_ctl_sock_init:
sctp_v6_protosw_exit(); sctp_v6_protosw_exit();
err_v6_protosw_init: err_v6_protosw_init:
...@@ -1328,7 +1330,7 @@ SCTP_STATIC __exit void sctp_exit(void) ...@@ -1328,7 +1330,7 @@ SCTP_STATIC __exit void sctp_exit(void)
sctp_v4_del_protocol(); sctp_v4_del_protocol();
/* Free the control endpoint. */ /* Free the control endpoint. */
sock_release(sctp_ctl_socket); sock_release(sctp_ctl_sock->sk_socket);
/* Free protosw registrations */ /* Free protosw registrations */
sctp_v6_protosw_exit(); sctp_v6_protosw_exit();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment