diff options
author | tuexen <tuexen@FreeBSD.org> | 2013-02-09 08:27:08 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2013-02-09 08:27:08 +0000 |
commit | 6b769b5afefaf0b88416cf767ecb7f0c9e004cd9 (patch) | |
tree | 12847ba482517b2d78be1fe404f4df8c38b51e5d /sys/netinet/sctp_pcb.c | |
parent | 538377b2eacd958c3efd0a185f87e25955afa4f2 (diff) | |
download | FreeBSD-src-6b769b5afefaf0b88416cf767ecb7f0c9e004cd9.zip FreeBSD-src-6b769b5afefaf0b88416cf767ecb7f0c9e004cd9.tar.gz |
Fix a bug where HEARTBEATs were still sent in SHUTDOWN_SENT or
SHUTDOWN_ACK_SENT state. While there, make the corresponding
code consistent.
MFC after: 1 week
Diffstat (limited to 'sys/netinet/sctp_pcb.c')
-rw-r--r-- | sys/netinet/sctp_pcb.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 4bd8cb8..9f817a3 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -3332,22 +3332,23 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) (SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; - if (asoc->asoc.alternate) { - netp = asoc->asoc.alternate; - } else { - netp = asoc->asoc.primary_destination; - } /* * there is nothing queued to send, * so I send shutdown */ - sctp_send_shutdown(asoc, netp); if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(asoc); + if (asoc->asoc.alternate) { + netp = asoc->asoc.alternate; + } else { + netp = asoc->asoc.primary_destination; + } + sctp_send_shutdown(asoc, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, asoc->sctp_ep, asoc, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, asoc->sctp_ep, asoc, |