Date: Tue, 26 Oct 2010 19:06:31 +0000 (UTC) From: Randall Stewart <rrs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r214393 - stable/8/sys/netinet Message-ID: <201010261906.o9QJ6V5D063130@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010261906.o9QJ6V5D063130>