summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2016-01-16 18:13:33 +0000
committertuexen <tuexen@FreeBSD.org>2016-01-16 18:13:33 +0000
commit0e3a8a377db0c9911339cedca6bf61c8b1212fe2 (patch)
tree549f8d7e3d2e11285f2d0d96e189634da35961a8 /sys/netinet
parent899778209f98dc0a41e18f6cc61fe3b3a95b0b92 (diff)
downloadFreeBSD-src-0e3a8a377db0c9911339cedca6bf61c8b1212fe2.zip
FreeBSD-src-0e3a8a377db0c9911339cedca6bf61c8b1212fe2.tar.gz
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).
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctp_pcb.c6
-rw-r--r--sys/netinet/sctp_usrreq.c7
2 files changed, 5 insertions, 8 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 0d28453..ab27a7e 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -3644,13 +3644,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from)
* 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;
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index 537a536..bd1b81a 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -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);
OpenPOWER on IntegriCloud