From owner-svn-src-stable@FreeBSD.ORG Tue Oct 26 19:06:32 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05EED1065675; Tue, 26 Oct 2010 19:06:32 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE40B8FC08; Tue, 26 Oct 2010 19:06:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9QJ6Vs5063132; Tue, 26 Oct 2010 19:06:31 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9QJ6V5D063130; Tue, 26 Oct 2010 19:06:31 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201010261906.o9QJ6V5D063130@svn.freebsd.org> From: Randall Stewart Date: Tue, 26 Oct 2010 19:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214393 - stable/8/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 19:06:32 -0000 Author: rrs Date: Tue Oct 26 19:06:31 2010 New Revision: 214393 URL: http://svn.freebsd.org/changeset/base/214393 Log: MFC:210494 Make sure that we report chunks if a socket still exists that were not sent. In either case carefully remove the data if it does not get taken by the reporting routines. Modified: stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Tue Oct 26 19:04:05 2010 (r214392) +++ stable/8/sys/netinet/sctp_pcb.c Tue Oct 26 19:06:31 2010 (r214393) @@ -4830,9 +4830,17 @@ sctp_free_assoc(struct sctp_inpcb *inp, while (sp) { TAILQ_REMOVE(&outs->outqueue, sp, next); if (sp->data) { - sctp_m_freem(sp->data); - sp->data = NULL; - sp->tail_mbuf = NULL; + if (so) { + /* Still an open socket - report */ + sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_UNSENT, + (void *)sp, 0); + } + if (sp->data) { + sctp_m_freem(sp->data); + sp->data = NULL; + sp->tail_mbuf = NULL; + } } sctp_free_remote_addr(sp->net); sctp_free_spbufspace(stcb, asoc, sp); @@ -4892,8 +4900,15 @@ sctp_free_assoc(struct sctp_inpcb *inp, while (chk) { TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; + if (so) { + /* Still a socket? */ + sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_UNSENT, chk, 0); + } + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } } if (chk->holds_key_ref) sctp_auth_key_release(stcb, chk->auth_keyid); @@ -4917,8 +4932,15 @@ sctp_free_assoc(struct sctp_inpcb *inp, while (chk) { TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; + if (so) { + /* Still a socket? */ + sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_SENT, chk, 0); + } + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } } if (chk->holds_key_ref) sctp_auth_key_release(stcb, chk->auth_keyid);