| 9132 | } |
| 9133 | |
| 9134 | void |
| 9135 | sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net) |
| 9136 | { |
| 9137 | /* formulate and queue a SHUTDOWN-ACK back to the sender */ |
| 9138 | struct mbuf *m_shutdown_ack; |
| 9139 | struct sctp_shutdown_ack_chunk *ack_cp; |
| 9140 | struct sctp_tmit_chunk *chk; |
| 9141 | |
| 9142 | m_shutdown_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_ack_chunk), 0, M_NOWAIT, 1, MT_HEADER); |
| 9143 | if (m_shutdown_ack == NULL) { |
| 9144 | /* no mbuf's */ |
| 9145 | return; |
| 9146 | } |
| 9147 | SCTP_BUF_RESV_UF(m_shutdown_ack, SCTP_MIN_OVERHEAD); |
| 9148 | sctp_alloc_a_chunk(stcb, chk); |
| 9149 | if (chk == NULL) { |
| 9150 | /* no memory */ |
| 9151 | sctp_m_freem(m_shutdown_ack); |
| 9152 | return; |
| 9153 | } |
| 9154 | chk->copy_by_ref = 0; |
| 9155 | chk->rec.chunk_id.id = SCTP_SHUTDOWN_ACK; |
| 9156 | chk->rec.chunk_id.can_take_data = 1; |
| 9157 | chk->flags = 0; |
| 9158 | chk->send_size = sizeof(struct sctp_chunkhdr); |
| 9159 | chk->sent = SCTP_DATAGRAM_UNSENT; |
| 9160 | chk->snd_count = 0; |
| 9161 | chk->asoc = &stcb->asoc; |
| 9162 | chk->data = m_shutdown_ack; |
| 9163 | chk->whoTo = net; |
| 9164 | if (chk->whoTo) { |
| 9165 | atomic_add_int(&chk->whoTo->ref_count, 1); |
| 9166 | } |
| 9167 | ack_cp = mtod(m_shutdown_ack, struct sctp_shutdown_ack_chunk *); |
| 9168 | ack_cp->ch.chunk_type = SCTP_SHUTDOWN_ACK; |
| 9169 | ack_cp->ch.chunk_flags = 0; |
| 9170 | ack_cp->ch.chunk_length = htons(chk->send_size); |
| 9171 | SCTP_BUF_LEN(m_shutdown_ack) = chk->send_size; |
| 9172 | TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next); |
| 9173 | chk->asoc->ctrl_queue_cnt++; |
| 9174 | return; |
| 9175 | } |
| 9176 | |
| 9177 | void |
| 9178 | sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net) |
no test coverage detected