netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, containers@lists.osdl.org,
	"Denis V. Lunev" <den@openvz.org>
Subject: [PATCH 5/11 net-2.6.26] [SCTP]: Replace socket with sock for sctp_ctl_sock.
Date: Fri, 28 Mar 2008 12:08:52 +0300	[thread overview]
Message-ID: <1206695338-5947-5-git-send-email-den@openvz.org> (raw)
In-Reply-To: <1206695071.3271.8.camel@iris.sw.ru>

Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 net/sctp/protocol.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 5b0323c..2715aca 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -74,7 +74,7 @@ DEFINE_SPINLOCK(sctp_assocs_id_lock);
  * 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;
@@ -91,7 +91,7 @@ int sysctl_sctp_wmem[3];
 /* 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. */
@@ -674,19 +674,21 @@ 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_csk_ctl_sock_create(&sctp_ctl_socket,
+	err = inet_csk_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;
 }
 
@@ -1284,7 +1286,7 @@ err_v6_add_protocol:
 	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:
@@ -1328,7 +1330,7 @@ SCTP_STATIC __exit void sctp_exit(void)
 	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();
-- 
1.5.3.rc5


  parent reply	other threads:[~2008-03-28  9:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28  9:04 [PATCH 0/11 net-2.6.16] unify control socket usage for protocols Denis V. Lunev
2008-03-28  9:08 ` [PATCH 1/11 net-2.6.26] [TCP]: Replace socket with sock for reset sending Denis V. Lunev
2008-03-28  9:08 ` [PATCH 2/11 net-2.6.26] [DCCP]: " Denis V. Lunev
     [not found]   ` <1206695338-5947-2-git-send-email-den-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-03-28 14:39     ` Arnaldo Carvalho de Melo
2008-03-28 15:08       ` Denis V. Lunev
2008-03-28  9:08 ` [PATCH 3/11 net-2.6.26] [DCCP]: dccp_v(4|6)_ctl_socket is leaked Denis V. Lunev
     [not found]   ` <1206695338-5947-3-git-send-email-den-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-03-28 14:44     ` Arnaldo Carvalho de Melo
2008-03-28 15:22       ` Denis V. Lunev
2008-03-28 16:47         ` Arnaldo Carvalho de Melo
     [not found]           ` <20080328164752.GX14945-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2008-03-28 17:09             ` Denis V. Lunev
2008-03-28 23:34               ` David Miller
2008-03-28  9:08 ` [PATCH 4/11 net-2.6.26] [SCTP]: Use inet_csk_ctl_sock_create for control socket creation Denis V. Lunev
2008-03-28  9:08 ` Denis V. Lunev [this message]
2008-03-28  9:08 ` [PATCH 6/11 net-2.6.26] [INET]: Let inet_csk_ctl_sock_create return sock rather than socket Denis V. Lunev
2008-03-28  9:08 ` [PATCH 7/11 net-2.6.26] [ICMP]: Simplify ICMP control socket creation Denis V. Lunev
     [not found]   ` <1206695338-5947-7-git-send-email-den-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-03-28 14:47     ` Arnaldo Carvalho de Melo
2008-03-28  9:08 ` [PATCH 8/11 net-2.6.26] [INET]: uc_ttl assignment in inet_csk_ctl_sock_create is extra Denis V. Lunev
2008-03-28  9:08 ` [PATCH 9/11 net-2.6.26] [IPV6]: Simplify IPv6 control socket creation Denis V. Lunev
2008-03-28  9:08 ` [PATCH 10/11] [NETNS]: Create tcp control socket in the each namespace Denis V. Lunev
2008-03-28  9:08 ` [PATCH 11/11 net-2.6.26] [NETNS]: Use TCP control socket from a correct namespace Denis V. Lunev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1206695338-5947-5-git-send-email-den@openvz.org \
    --to=den@openvz.org \
    --cc=containers@lists.osdl.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).