Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jul 2009 18:37:20 +0000 (UTC)
From:      Bruce M Simpson <bms@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r195771 - stable/7/sys/netinet
Message-ID:  <200907191837.n6JIbKme050987@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bms
Date: Sun Jul 19 18:37:20 2009
New Revision: 195771
URL: http://svn.freebsd.org/changeset/base/195771

Log:
  When moving an SCTP association from one hash table to another,
  make sure the association's link entry in the hash table is updated.
  This fixes a panic on closing an association in the 7.x SCTP stack.
  
  Observed on 7.2-STABLE/amd64.
  
  Submitted by:   Michael Tuexen
  Reviewed by:    rrs

Modified:
  stable/7/sys/netinet/sctp_pcb.c

Modified: stable/7/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/7/sys/netinet/sctp_pcb.c	Sun Jul 19 18:36:54 2009	(r195770)
+++ stable/7/sys/netinet/sctp_pcb.c	Sun Jul 19 18:37:20 2009	(r195771)
@@ -2504,7 +2504,9 @@ sctp_move_pcb_and_assoc(struct sctp_inpc
 	/* Pull the tcb from the old association */
 	LIST_REMOVE(stcb, sctp_tcbhash);
 	LIST_REMOVE(stcb, sctp_tcblist);
-
+	if (stcb->asoc.in_asocid_hash) {
+		LIST_REMOVE(stcb, sctp_tcbasocidhash);
+	}
 	/* Now insert the new_inp into the TCP connected hash */
 	head = &SCTP_BASE_INFO(sctp_tcpephash)[SCTP_PCBHASH_ALLADDR((lport),
 	    SCTP_BASE_INFO(hashtcpmark))];
@@ -2520,7 +2522,12 @@ sctp_move_pcb_and_assoc(struct sctp_inpc
 	 * only have one connection? Probably not :> so lets get rid of it
 	 * and not suck up any kernel memory in that.
 	 */
-
+	if (stcb->asoc.in_asocid_hash) {
+	    struct sctpasochead *lhd;
+	    lhd = &new_inp->sctp_asocidhash[SCTP_PCBHASH_ASOC(stcb->asoc.assoc_id,
+		     new_inp->hashasocidmark)];
+	    LIST_INSERT_HEAD(lhd, stcb, sctp_tcbasocidhash);
+	}
 	/* Ok. Let's restart timer. */
 	TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
 		sctp_timer_start(SCTP_TIMER_TYPE_PATHMTURAISE, new_inp,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907191837.n6JIbKme050987>