Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jan 2016 18:13:33 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r294184 - stable/10/sys/netinet
Message-ID:  <201601161813.u0GIDXGH060153@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sat Jan 16 18:13:33 2016
New Revision: 294184
URL: https://svnweb.freebsd.org/changeset/base/294184

Log:
  MFC r291137:
  Don't send SHUTDOWN chunk when the association is in a front state
  and the applications calls shutdown(..., SHUT_WR) or
  shutdown(..., SHUT_RDWR).

Modified:
  stable/10/sys/netinet/sctp_pcb.c
  stable/10/sys/netinet/sctp_usrreq.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/sctp_pcb.c
==============================================================================
--- stable/10/sys/netinet/sctp_pcb.c	Sat Jan 16 18:13:28 2016	(r294183)
+++ stable/10/sys/netinet/sctp_pcb.c	Sat Jan 16 18:13:33 2016	(r294184)
@@ -3644,13 +3644,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, 
 	 * macro here since le_next will get freed as part of the
 	 * sctp_free_assoc() call.
 	 */
-	if (so) {
 #ifdef IPSEC
+	if (ip_pcb->inp_sp != NULL) {
 		ipsec_delete_pcbpolicy(ip_pcb);
-#endif				/* IPSEC */
-
-		/* Unlocks not needed since the socket is gone now */
 	}
+#endif
 	if (ip_pcb->inp_options) {
 		(void)sctp_m_free(ip_pcb->inp_options);
 		ip_pcb->inp_options = 0;

Modified: stable/10/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/10/sys/netinet/sctp_usrreq.c	Sat Jan 16 18:13:28 2016	(r294183)
+++ stable/10/sys/netinet/sctp_usrreq.c	Sat Jan 16 18:13:33 2016	(r294184)
@@ -1007,16 +1007,15 @@ sctp_shutdown(struct socket *so)
 		} else {
 			netp = stcb->asoc.primary_destination;
 		}
-		if (TAILQ_EMPTY(&asoc->send_queue) &&
+		if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) &&
+		    TAILQ_EMPTY(&asoc->send_queue) &&
 		    TAILQ_EMPTY(&asoc->sent_queue) &&
 		    (asoc->stream_queue_cnt == 0)) {
 			if (asoc->locked_on_sending) {
 				goto abort_anyway;
 			}
 			/* there is nothing queued to send, so I'm done... */
-			if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) {
-				SCTP_STAT_DECR_GAUGE32(sctps_currestab);
-			}
+			SCTP_STAT_DECR_GAUGE32(sctps_currestab);
 			SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT);
 			SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING);
 			sctp_stop_timers_for_shutdown(stcb);



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