From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 18:37:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 229AA10656A8; Sun, 19 Jul 2009 18:37:21 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 102AE8FC1A; Sun, 19 Jul 2009 18:37:21 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JIbKMp050989; Sun, 19 Jul 2009 18:37:20 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JIbKme050987; Sun, 19 Jul 2009 18:37:20 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200907191837.n6JIbKme050987@svn.freebsd.org> From: Bruce M Simpson Date: Sun, 19 Jul 2009 18:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195771 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 18:37:22 -0000 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,