svn commit: r195771 - stable/7/sys/netinet
Bruce M Simpson
bms at FreeBSD.org
Sun Jul 19 18:37:22 UTC 2009
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,
More information about the svn-src-stable
mailing list