diff options
author | tuexen <tuexen@FreeBSD.org> | 2013-05-17 21:45:52 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2013-05-17 21:45:52 +0000 |
commit | d482c3688dafdd43aadc9a8ace6d5cc9b537c52f (patch) | |
tree | 4e279914db8ce8da1bda46a26aab289f8a688cb9 | |
parent | f2e601b1f609fdd36ada06e3b99676da01b60102 (diff) | |
download | FreeBSD-src-d482c3688dafdd43aadc9a8ace6d5cc9b537c52f.zip FreeBSD-src-d482c3688dafdd43aadc9a8ace6d5cc9b537c52f.tar.gz |
Don't send an ABORT chunk with verification 0.
MFC after: 1 week
-rw-r--r-- | sys/netinet/sctp_output.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 5f43ba1..59c22c7 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -10669,6 +10669,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked struct sctp_abort_chunk *abort; struct sctp_auth_chunk *auth = NULL; struct sctp_nets *net; + uint32_t vtag; uint32_t auth_offset = 0; uint16_t cause_len, chunk_len, padding_len; @@ -10724,7 +10725,14 @@ sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked /* Fill in the ABORT chunk header. */ abort = mtod(m_abort, struct sctp_abort_chunk *); abort->ch.chunk_type = SCTP_ABORT_ASSOCIATION; - abort->ch.chunk_flags = 0; + if (stcb->asoc.peer_vtag == 0) { + /* This happens iff the assoc is in COOKIE-WAIT state. */ + vtag = stcb->asoc.my_vtag; + abort->ch.chunk_flags = SCTP_HAD_NO_TCB; + } else { + vtag = stcb->asoc.peer_vtag; + abort->ch.chunk_flags = 0; + } abort->ch.chunk_length = htons(chunk_len); /* Add padding, if necessary. */ if (padding_len > 0) { @@ -10736,7 +10744,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, - stcb->sctp_ep->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), + stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), stcb->asoc.primary_destination->port, NULL, 0, 0, so_locked); |