| 3049 | } |
| 3050 | |
| 3051 | static void |
| 3052 | sctp_handle_shutdown_complete(struct sctp_shutdown_complete_chunk *cp SCTP_UNUSED, |
| 3053 | struct sctp_tcb *stcb, struct sctp_nets *net) |
| 3054 | { |
| 3055 | |
| 3056 | SCTPDBG(SCTP_DEBUG_INPUT2, |
| 3057 | "sctp_handle_shutdown_complete: handling SHUTDOWN-COMPLETE\n"); |
| 3058 | if (stcb == NULL) |
| 3059 | return; |
| 3060 | |
| 3061 | /* process according to association state */ |
| 3062 | if (SCTP_GET_STATE(stcb) != SCTP_STATE_SHUTDOWN_ACK_SENT) { |
| 3063 | /* unexpected SHUTDOWN-COMPLETE... so ignore... */ |
| 3064 | SCTPDBG(SCTP_DEBUG_INPUT2, |
| 3065 | "sctp_handle_shutdown_complete: not in SCTP_STATE_SHUTDOWN_ACK_SENT --- ignore\n"); |
| 3066 | SCTP_TCB_UNLOCK(stcb); |
| 3067 | return; |
| 3068 | } |
| 3069 | /* notify upper layer protocol */ |
| 3070 | if (stcb->sctp_socket) { |
| 3071 | sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); |
| 3072 | } |
| 3073 | #ifdef INVARIANTS |
| 3074 | if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || |
| 3075 | !TAILQ_EMPTY(&stcb->asoc.sent_queue) || |
| 3076 | sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED)) { |
| 3077 | panic("Queues are not empty when handling SHUTDOWN-COMPLETE"); |
| 3078 | } |
| 3079 | #endif |
| 3080 | /* stop the timer */ |
| 3081 | sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net, |
| 3082 | SCTP_FROM_SCTP_INPUT + SCTP_LOC_24); |
| 3083 | SCTP_STAT_INCR_COUNTER32(sctps_shutdown); |
| 3084 | /* free the TCB */ |
| 3085 | SCTPDBG(SCTP_DEBUG_INPUT2, |
| 3086 | "sctp_handle_shutdown_complete: calls free-asoc\n"); |
| 3087 | (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, |
| 3088 | SCTP_FROM_SCTP_INPUT + SCTP_LOC_25); |
| 3089 | return; |
| 3090 | } |
| 3091 | |
| 3092 | static int |
| 3093 | process_chunk_drop(struct sctp_tcb *stcb, struct sctp_chunk_desc *desc, |
no test coverage detected