diff options
-rw-r--r-- | sys/netinet/sctp_auth.c | 16 | ||||
-rw-r--r-- | sys/netinet/sctp_indata.c | 6 | ||||
-rw-r--r-- | sys/netinet/sctp_input.c | 213 | ||||
-rw-r--r-- | sys/netinet/sctp_input.h | 2 | ||||
-rw-r--r-- | sys/netinet/sctp_output.c | 107 | ||||
-rw-r--r-- | sys/netinet/sctp_output.h | 17 | ||||
-rw-r--r-- | sys/netinet/sctp_pcb.c | 83 | ||||
-rw-r--r-- | sys/netinet/sctp_timer.c | 12 | ||||
-rw-r--r-- | sys/netinet/sctp_uio.h | 2 | ||||
-rw-r--r-- | sys/netinet/sctp_usrreq.c | 12 | ||||
-rw-r--r-- | sys/netinet/sctp_var.h | 6 | ||||
-rw-r--r-- | sys/netinet/sctputil.c | 69 | ||||
-rw-r--r-- | sys/netinet/sctputil.h | 2 | ||||
-rw-r--r-- | sys/netinet6/sctp6_usrreq.c | 2 |
14 files changed, 298 insertions, 251 deletions
diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c index 208634247321..61263b7a12a9 100644 --- a/sys/netinet/sctp_auth.c +++ b/sys/netinet/sctp_auth.c @@ -169,8 +169,8 @@ sctp_auth_get_chklist_size(const sctp_auth_chklist_t * list) void sctp_auth_set_default_chunks(sctp_auth_chklist_t * list) { - sctp_auth_add_chunk(SCTP_ASCONF, list); - sctp_auth_add_chunk(SCTP_ASCONF_ACK, list); + (void)sctp_auth_add_chunk(SCTP_ASCONF, list); + (void)sctp_auth_add_chunk(SCTP_ASCONF_ACK, list); } /* @@ -239,7 +239,7 @@ sctp_unpack_auth_chunks(const uint8_t * ptr, uint8_t num_chunks, if (num_chunks <= 32) { /* just pull them, one byte each */ for (i = 0; i < num_chunks; i++) { - sctp_auth_add_chunk(*ptr++, list); + (void)sctp_auth_add_chunk(*ptr++, list); } size = num_chunks; } else { @@ -249,7 +249,7 @@ sctp_unpack_auth_chunks(const uint8_t * ptr, uint8_t num_chunks, for (index = 0; index < 32; index++) { for (offset = 0; offset < 8; offset++) { if (ptr[index] & (1 << offset)) { - sctp_auth_add_chunk((index * 8) + offset, list); + (void)sctp_auth_add_chunk((index * 8) + offset, list); } } } @@ -695,8 +695,8 @@ sctp_default_supported_hmaclist(void) new_list = sctp_alloc_hmaclist(2); if (new_list == NULL) return (NULL); - sctp_auth_add_hmacid(new_list, SCTP_AUTH_HMAC_ID_SHA1); - sctp_auth_add_hmacid(new_list, SCTP_AUTH_HMAC_ID_SHA256); + (void)sctp_auth_add_hmacid(new_list, SCTP_AUTH_HMAC_ID_SHA1); + (void)sctp_auth_add_hmacid(new_list, SCTP_AUTH_HMAC_ID_SHA256); return (new_list); } @@ -1465,7 +1465,7 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m, stcb->asoc.local_hmacs = sctp_alloc_hmaclist(num_hmacs); if (stcb->asoc.local_hmacs != NULL) { for (i = 0; i < num_hmacs; i++) { - sctp_auth_add_hmacid(stcb->asoc.local_hmacs, + (void)sctp_auth_add_hmacid(stcb->asoc.local_hmacs, ntohs(hmacs->hmac_ids[i])); } } @@ -1486,7 +1486,7 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m, else stcb->asoc.local_auth_chunks = sctp_alloc_chunklist(); for (i = 0; i < num_chunks; i++) { - sctp_auth_add_chunk(chunks->chunk_types[i], + (void)sctp_auth_add_chunk(chunks->chunk_types[i], stcb->asoc.local_auth_chunks); } } diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 3f30220c1a1a..6ca9985e71bc 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -2792,7 +2792,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, */ SCTP_STAT_INCR(sctps_recvpktwithdata); stcb->asoc.overall_error_count = 0; - SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_last_rcvd); + (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_last_rcvd); } /* now service all of the reassm queue if needed */ if (!(TAILQ_EMPTY(&asoc->reasmqueue))) @@ -3234,7 +3234,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc, } } if (stcb->asoc.peer_supports_prsctp) { - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); } tp1 = TAILQ_FIRST(&asoc->sent_queue); while (tp1) { @@ -3653,7 +3653,7 @@ sctp_try_advance_peer_ack_point(struct sctp_tcb *stcb, break; } if (!now_filled) { - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); now_filled = 1; } tp2 = TAILQ_NEXT(tp1, sctp_next); diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 97ca903cd82b..68b1636c9d27 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -610,7 +610,7 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, sctp_ulp_notify(SCTP_NOTIFY_PEER_SHUTDOWN, stcb, 0, NULL); /* reset time */ - SCTP_GETTIME_TIMEVAL(&asoc->time_entered); + (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); } } if (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_SENT) { @@ -1036,7 +1036,7 @@ sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, /* reset the RTO calc */ stcb->asoc.overall_error_count = 0; - SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); + (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); /* * collapse the init timer back in case of a exponential * backoff @@ -1951,12 +1951,12 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, if ((cookie->time_entered.tv_sec < (long)ep->time_of_secret_change) && (ep->current_secret_number != ep->last_secret_number)) { /* it's the old cookie */ - sctp_hmac_m(SCTP_HMAC, + (void)sctp_hmac_m(SCTP_HMAC, (uint8_t *) ep->secret_key[(int)ep->last_secret_number], SCTP_SECRET_SIZE, m, cookie_offset, calc_sig); } else { /* it's the current cookie */ - sctp_hmac_m(SCTP_HMAC, + (void)sctp_hmac_m(SCTP_HMAC, (uint8_t *) ep->secret_key[(int)ep->current_secret_number], SCTP_SECRET_SIZE, m, cookie_offset, calc_sig); } @@ -1974,7 +1974,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, if ((cookie->time_entered.tv_sec == (long)ep->time_of_secret_change) && (ep->current_secret_number != ep->last_secret_number)) { /* compute digest with old */ - sctp_hmac_m(SCTP_HMAC, + (void)sctp_hmac_m(SCTP_HMAC, (uint8_t *) ep->secret_key[(int)ep->last_secret_number], SCTP_SECRET_SIZE, m, cookie_offset, calc_sig); /* compare */ @@ -2012,7 +2012,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, /* * check the cookie timestamps to be sure it's not stale */ - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); /* Expire time is in Ticks, so we convert to seconds */ time_expires.tv_sec = cookie->time_entered.tv_sec + cookie->cookie_life; time_expires.tv_usec = cookie->time_entered.tv_usec; @@ -2325,7 +2325,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *cp, net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered); } - SCTP_GETTIME_TIMEVAL(&asoc->time_entered); + (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { @@ -2700,7 +2700,7 @@ process_chunk_drop(struct sctp_tcb *stcb, struct sctp_chunk_desc *desc, break; case SCTP_HEARTBEAT_REQUEST: /* resend a demand HB */ - sctp_send_hb(stcb, 1, net); + (void)sctp_send_hb(stcb, 1, net); break; case SCTP_SHUTDOWN: sctp_send_shutdown(stcb, net); @@ -3589,8 +3589,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, if (vtag_in != 0) { /* protocol error- silently discard... */ SCTP_STAT_INCR(sctps_badvtag); - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } } else if (ch->chunk_type != SCTP_COOKIE_ECHO) { @@ -3661,8 +3662,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, sctp_handle_ootb(m, iphlen, *offset, sh, inp, NULL, vrf_id, table_id); *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } asoc = &stcb->asoc; @@ -3677,8 +3679,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, } else { /* drop this packet... */ SCTP_STAT_INCR(sctps_badvtag); - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } } else if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { @@ -3690,8 +3693,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, * but it won't complete until the shutdown * is completed */ - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } sctp_handle_ootb(m, iphlen, *offset, sh, inp, NULL, vrf_id, table_id); return (NULL); @@ -3706,8 +3710,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, } #endif /* SCTP_DEBUG */ SCTP_STAT_INCR(sctps_badvtag); - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } @@ -3737,8 +3742,9 @@ process_control_chunks: if ((size_t)chk_length < sizeof(*ch) || (*offset + chk_length) > length) { *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } SCTP_STAT_INCR_COUNTER64(sctps_incontrolchunks); @@ -3754,8 +3760,9 @@ process_control_chunks: sizeof(struct sctp_init_ack_chunk), chunk_buf); if (ch == NULL) { *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } } else if (ch->chunk_type == SCTP_COOKIE_ECHO) { @@ -3772,8 +3779,9 @@ process_control_chunks: chunk_buf); if (ch == NULL) { *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } } else { @@ -3801,8 +3809,9 @@ process_control_chunks: sctp_queue_op_err(stcb, oper); } } - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } all_fits: @@ -3811,8 +3820,9 @@ process_control_chunks: if (ch == NULL) { printf("sctp_process_control: Can't get the all data....\n"); *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } } @@ -3858,8 +3868,9 @@ process_control_chunks: */ ; } else { - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } @@ -3867,8 +3878,9 @@ process_control_chunks: if ((num_chunks > 1) || (sctp_strict_init && (length - *offset > SCTP_SIZE32(chk_length)))) { *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } if ((stcb != NULL) && @@ -3878,8 +3890,9 @@ process_control_chunks: stcb->asoc.primary_destination); *offset = length; sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC); - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } sctp_handle_init(m, iphlen, *offset, sh, @@ -3888,8 +3901,9 @@ process_control_chunks: return (NULL); *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); break; case SCTP_INITIATION_ACK: @@ -3904,8 +3918,9 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else { - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; if (stcb) { sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_26); @@ -3916,8 +3931,9 @@ process_control_chunks: if ((num_chunks > 1) || (sctp_strict_init && (length - *offset > SCTP_SIZE32(chk_length)))) { *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } ret = sctp_handle_init_ack(m, iphlen, *offset, sh, @@ -3932,8 +3948,9 @@ process_control_chunks: if ((stcb) && ret == 0) sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC); *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); break; case SCTP_SELECTIVE_ACK: @@ -3957,9 +3974,9 @@ process_control_chunks: } #endif *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); - + } return (NULL); } sack = (struct sctp_sack_chunk *)ch; @@ -4018,8 +4035,9 @@ process_control_chunks: if (chk_length != sizeof(struct sctp_heartbeat_chunk)) { /* Its not ours */ *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } /* He's alive so give him credit */ @@ -4047,8 +4065,9 @@ process_control_chunks: #endif /* SCTP_DEBUG */ if (chk_length != sizeof(struct sctp_shutdown_chunk)) { *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } { @@ -4078,7 +4097,7 @@ process_control_chunks: printf("SCTP_OP-ERR\n"); } #endif /* SCTP_DEBUG */ - if (sctp_handle_error(ch, stcb, *netp) < 0) { + if ((stcb) && sctp_handle_error(ch, stcb, *netp) < 0) { *offset = length; return (NULL); } @@ -4216,8 +4235,9 @@ process_control_chunks: } #endif /* SCTP_DEBUG */ if (chk_length != sizeof(struct sctp_cookie_ack_chunk)) { - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } return (NULL); } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { @@ -4231,8 +4251,10 @@ process_control_chunks: } } /* He's alive so give him credit */ - stcb->asoc.overall_error_count = 0; - sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp); + if (stcb) { + stcb->asoc.overall_error_count = 0; + sctp_handle_cookie_ack((struct sctp_cookie_ack_chunk *)ch, stcb, *netp); + } break; case SCTP_ECN_ECHO: #ifdef SCTP_DEBUG @@ -4243,14 +4265,17 @@ process_control_chunks: /* He's alive so give him credit */ if (chk_length != sizeof(struct sctp_ecne_chunk)) { /* Its not ours */ - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } - stcb->asoc.overall_error_count = 0; - sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, - stcb); + if (stcb) { + stcb->asoc.overall_error_count = 0; + sctp_handle_ecn_echo((struct sctp_ecne_chunk *)ch, + stcb); + } break; case SCTP_ECN_CWR: #ifdef SCTP_DEBUG @@ -4261,14 +4286,16 @@ process_control_chunks: /* He's alive so give him credit */ if (chk_length != sizeof(struct sctp_cwr_chunk)) { /* Its not ours */ - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } - stcb->asoc.overall_error_count = 0; - - sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb); + if (stcb) { + stcb->asoc.overall_error_count = 0; + sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb); + } break; case SCTP_SHUTDOWN_COMPLETE: #ifdef SCTP_DEBUG @@ -4280,13 +4307,15 @@ process_control_chunks: if ((num_chunks > 1) || (length - *offset > SCTP_SIZE32(chk_length))) { *offset = length; - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); - + } return (NULL); } - sctp_handle_shutdown_complete((struct sctp_shutdown_complete_chunk *)ch, - stcb, *netp); + if (stcb) { + sctp_handle_shutdown_complete((struct sctp_shutdown_complete_chunk *)ch, + stcb, *netp); + } *offset = length; return (NULL); break; @@ -4297,10 +4326,11 @@ process_control_chunks: } #endif /* SCTP_DEBUG */ /* He's alive so give him credit */ - stcb->asoc.overall_error_count = 0; - - sctp_handle_asconf(m, *offset, - (struct sctp_asconf_chunk *)ch, stcb); + if (stcb) { + stcb->asoc.overall_error_count = 0; + sctp_handle_asconf(m, *offset, + (struct sctp_asconf_chunk *)ch, stcb); + } break; case SCTP_ASCONF_ACK: #ifdef SCTP_DEBUG @@ -4310,16 +4340,18 @@ process_control_chunks: #endif /* SCTP_DEBUG */ if (chk_length < sizeof(struct sctp_asconf_ack_chunk)) { /* Its not ours */ - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } - /* He's alive so give him credit */ - stcb->asoc.overall_error_count = 0; - - sctp_handle_asconf_ack(m, *offset, - (struct sctp_asconf_ack_chunk *)ch, stcb, *netp); + if (stcb) { + /* He's alive so give him credit */ + stcb->asoc.overall_error_count = 0; + sctp_handle_asconf_ack(m, *offset, + (struct sctp_asconf_ack_chunk *)ch, stcb, *netp); + } break; case SCTP_FORWARD_CUM_TSN: #ifdef SCTP_DEBUG @@ -4329,13 +4361,14 @@ process_control_chunks: #endif /* SCTP_DEBUG */ if (chk_length < sizeof(struct sctp_forward_tsn_chunk)) { /* Its not ours */ - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } /* He's alive so give him credit */ - { + if (stcb) { int abort_flag = 0; stcb->asoc.overall_error_count = 0; @@ -4367,8 +4400,9 @@ process_control_chunks: chk_length, chunk_buf); if (chk_length < sizeof(struct sctp_stream_reset_tsn_req)) { /* Its not ours */ - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } @@ -4378,18 +4412,21 @@ process_control_chunks: *offset = length; return (NULL); } - if (stcb->asoc.peer_supports_strreset == 0) { - /* - * hmm, peer should have announced this, but - * we will turn it on since he is sending us - * a stream reset. - */ - stcb->asoc.peer_supports_strreset = 1; - } - if (sctp_handle_stream_reset(stcb, (struct sctp_stream_reset_out_req *)ch)) { - /* stop processing */ - *offset = length; - return (NULL); + if (stcb) { + if (stcb->asoc.peer_supports_strreset == 0) { + /* + * hmm, peer should have announced + * this, but we will turn it on + * since he is sending us a stream + * reset. + */ + stcb->asoc.peer_supports_strreset = 1; + } + if (sctp_handle_stream_reset(stcb, (struct sctp_stream_reset_out_req *)ch)) { + /* stop processing */ + *offset = length; + return (NULL); + } } break; case SCTP_PACKET_DROPPED: @@ -4401,17 +4438,19 @@ process_control_chunks: /* re-get it all please */ if (chk_length < sizeof(struct sctp_pktdrop_chunk)) { /* Its not ours */ - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, chk_length, chunk_buf); - sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch, - stcb, *netp); - + if ((stcb) && (*netp)) { + sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch, + stcb, *netp); + } break; case SCTP_AUTHENTICATION: @@ -4436,8 +4475,9 @@ process_control_chunks: if ((chk_length < (sizeof(struct sctp_auth_chunk))) || (chk_length > (sizeof(struct sctp_auth_chunk) + SCTP_AUTH_DIGEST_LEN_MAX))) { /* Its not ours */ - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } @@ -4508,8 +4548,9 @@ next_chunk: ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, sizeof(struct sctp_chunkhdr), chunk_buf); if (ch == NULL) { - if (locked_tcb) + if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); + } *offset = length; return (NULL); } @@ -4584,7 +4625,7 @@ sctp_process_ecn_marked_b(struct sctp_tcb *stcb, struct sctp_nets *net, /* * common input chunk processing (v4 and v6) */ -int +void sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, @@ -4645,19 +4686,19 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, /* "silently" ignore */ SCTP_STAT_INCR(sctps_recvauthmissing); SCTP_TCB_UNLOCK(stcb); - return (1); + return; } if (stcb == NULL) { /* out of the blue DATA chunk */ sctp_handle_ootb(m, iphlen, offset, sh, inp, NULL, vrf_id, table_id); - return (1); + return; } if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) { /* v_tag mismatch! */ SCTP_STAT_INCR(sctps_badvtag); SCTP_TCB_UNLOCK(stcb); - return (1); + return; } } @@ -4667,7 +4708,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, * packet while processing control, or we're done with this * packet (done or skip rest of data), so we drop it... */ - return (1); + return; } /* * DATA chunk processing @@ -4715,7 +4756,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, sctp_handle_ootb(m, iphlen, offset, sh, inp, NULL, vrf_id, table_id); SCTP_TCB_UNLOCK(stcb); - return (1); + return; break; case SCTP_STATE_EMPTY: /* should not happen */ case SCTP_STATE_INUSE: /* should not happen */ @@ -4723,7 +4764,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, case SCTP_STATE_SHUTDOWN_ACK_SENT: default: SCTP_TCB_UNLOCK(stcb); - return (1); + return; break; case SCTP_STATE_OPEN: case SCTP_STATE_SHUTDOWN_SENT: @@ -4742,7 +4783,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, * The association aborted, NO UNLOCK needed since * the association is destroyed. */ - return (0); + return; } data_processed = 1; if (retval == 0) { @@ -4769,7 +4810,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, sctp_sack_check(stcb, 1, was_a_gap, &abort_flag); if (abort_flag) { /* Again, we aborted so NO UNLOCK needed */ - return (0); + return; } } /* trigger send of any chunks in queue... */ @@ -4809,7 +4850,7 @@ trigger_send: sctp_auditing(2, inp, stcb, net); #endif SCTP_TCB_UNLOCK(stcb); - return (0); + return; } diff --git a/sys/netinet/sctp_input.h b/sys/netinet/sctp_input.h index 047cab480239..192e3b183014 100644 --- a/sys/netinet/sctp_input.h +++ b/sys/netinet/sctp_input.h @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #define __sctp_input_h__ #if defined(_KERNEL) -int +void sctp_common_input_processing(struct mbuf **, int, int, int, struct sctphdr *, struct sctp_chunkhdr *, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint8_t, uint32_t, uint32_t); diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index b13e9c4e8e6d..80fab0b0bcad 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -3245,7 +3245,7 @@ sctp_add_cookie(struct sctp_inpcb *inp, struct mbuf *init, int init_offset, sig_offset = 0; signature = (uint8_t *) (mtod(sig, caddr_t)+sig_offset); /* Time to sign the cookie */ - sctp_hmac_m(SCTP_HMAC, + (void)sctp_hmac_m(SCTP_HMAC, (uint8_t *) inp->sctp_ep.secret_key[(int)(inp->sctp_ep.current_secret_number)], SCTP_SECRET_SIZE, mret, sizeof(struct sctp_paramhdr), (uint8_t *) signature); @@ -4111,7 +4111,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb) m, 0, NULL, 0, 0, NULL, 0); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, net); - SCTP_GETTIME_TIMEVAL(&net->last_sent_time); + (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); } struct mbuf * @@ -4625,7 +4625,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, SCTP_BUF_LEN(m) = sizeof(struct sctp_init_msg); /* the time I built cookie */ - SCTP_GETTIME_TIMEVAL(&stc.time_entered); + (void)SCTP_GETTIME_TIMEVAL(&stc.time_entered); /* populate any tie tags */ if (asoc != NULL) { @@ -5384,7 +5384,7 @@ sctp_set_prsctp_policy(struct sctp_tcb *stcb, { struct timeval tv; - SCTP_GETTIME_TIMEVAL(&sp->ts); + (void)SCTP_GETTIME_TIMEVAL(&sp->ts); tv.tv_sec = sp->timetolive / 1000; tv.tv_usec = (sp->timetolive * 1000) % 1000000; timevaladd(&sp->ts, &tv); @@ -5463,7 +5463,7 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->addr_over = 0; } atomic_add_int(&sp->net->ref_count, 1); - SCTP_GETTIME_TIMEVAL(&sp->ts); + (void)SCTP_GETTIME_TIMEVAL(&sp->ts); sp->stream = srcv->sinfo_stream; sp->msg_is_complete = 1; sp->sender_all_done = 1; @@ -7193,7 +7193,7 @@ again_one_more_time: /* error, could not output */ if (hbflag) { if (*now_filled == 0) { - SCTP_GETTIME_TIMEVAL(&net->last_sent_time); + (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); *now_filled = 1; *now = net->last_sent_time; } else { @@ -7216,7 +7216,7 @@ again_one_more_time: /* Only HB or ASCONF advances time */ if (hbflag) { if (*now_filled == 0) { - SCTP_GETTIME_TIMEVAL(&net->last_sent_time); + (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); *now_filled = 1; *now = net->last_sent_time; } else { @@ -7468,7 +7468,7 @@ again_one_more_time: #endif if (hbflag) { if (*now_filled == 0) { - SCTP_GETTIME_TIMEVAL(&net->last_sent_time); + (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); *now_filled = 1; *now = net->last_sent_time; } else { @@ -7502,7 +7502,7 @@ again_one_more_time: if (bundle_at || hbflag) { /* For data/asconf and hb set time */ if (*now_filled == 0) { - SCTP_GETTIME_TIMEVAL(&net->last_sent_time); + (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); *now_filled = 1; *now = net->last_sent_time; } else { @@ -7750,7 +7750,7 @@ sctp_send_heartbeat_ack(struct sctp_tcb *stcb, chk->asoc->ctrl_queue_cnt++; } -int +void sctp_send_cookie_ack(struct sctp_tcb *stcb) { /* formulate and queue a cookie-ack back to sender */ @@ -7764,14 +7764,14 @@ sctp_send_cookie_ack(struct sctp_tcb *stcb) cookie_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_DONTWAIT, 1, MT_HEADER); if (cookie_ack == NULL) { /* no mbuf's */ - return (-1); + return; } SCTP_BUF_RESV_UF(cookie_ack, SCTP_MIN_OVERHEAD); sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { /* no memory */ sctp_m_freem(cookie_ack); - return (-1); + return; } chk->copy_by_ref = 0; chk->send_size = sizeof(struct sctp_chunkhdr); @@ -7795,11 +7795,11 @@ sctp_send_cookie_ack(struct sctp_tcb *stcb) SCTP_BUF_LEN(cookie_ack) = chk->send_size; TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next); chk->asoc->ctrl_queue_cnt++; - return (0); + return; } -int +void sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net) { /* formulate and queue a SHUTDOWN-ACK back to the sender */ @@ -7810,14 +7810,14 @@ sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net) m_shutdown_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_ack_chunk), 0, M_DONTWAIT, 1, MT_HEADER); if (m_shutdown_ack == NULL) { /* no mbuf's */ - return (-1); + return; } SCTP_BUF_RESV_UF(m_shutdown_ack, SCTP_MIN_OVERHEAD); sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { /* no memory */ sctp_m_freem(m_shutdown_ack); - return (-1); + return; } chk->copy_by_ref = 0; @@ -7839,10 +7839,10 @@ sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net) SCTP_BUF_LEN(m_shutdown_ack) = chk->send_size; TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next); chk->asoc->ctrl_queue_cnt++; - return (0); + return; } -int +void sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net) { /* formulate and queue a SHUTDOWN to the sender */ @@ -7853,14 +7853,14 @@ sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net) m_shutdown = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_chunk), 0, M_DONTWAIT, 1, MT_HEADER); if (m_shutdown == NULL) { /* no mbuf's */ - return (-1); + return; } SCTP_BUF_RESV_UF(m_shutdown, SCTP_MIN_OVERHEAD); sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { /* no memory */ sctp_m_freem(m_shutdown); - return (-1); + return; } chk->copy_by_ref = 0; chk->send_size = sizeof(struct sctp_shutdown_chunk); @@ -7882,10 +7882,10 @@ sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net) SCTP_BUF_LEN(m_shutdown) = chk->send_size; TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next); chk->asoc->ctrl_queue_cnt++; - return (0); + return; } -int +void sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_nets *net) { /* @@ -7902,14 +7902,14 @@ sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_nets *net) /* compose an ASCONF chunk, maximum length is PMTU */ m_asconf = sctp_compose_asconf(stcb, &len); if (m_asconf == NULL) { - return (-1); + return; } acp = mtod(m_asconf, struct sctp_asconf_chunk *); sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { /* no memory */ sctp_m_freem(m_asconf); - return (-1); + return; } chk->copy_by_ref = 0; chk->data = m_asconf; @@ -7924,10 +7924,10 @@ sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_nets *net) atomic_add_int(&chk->whoTo->ref_count, 1); TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next); chk->asoc->ctrl_queue_cnt++; - return (0); + return; } -int +void sctp_send_asconf_ack(struct sctp_tcb *stcb, uint32_t retrans) { /* @@ -7940,21 +7940,21 @@ sctp_send_asconf_ack(struct sctp_tcb *stcb, uint32_t retrans) SCTP_TCB_LOCK_ASSERT(stcb); /* is there a asconf-ack mbuf chain to send? */ if (stcb->asoc.last_asconf_ack_sent == NULL) { - return (-1); + return; } /* copy the asconf_ack */ m_ack = SCTP_M_COPYM(stcb->asoc.last_asconf_ack_sent, 0, M_COPYALL, M_DONTWAIT); if (m_ack == NULL) { /* couldn't copy it */ - return (-1); + return; } sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { /* no memory */ if (m_ack) sctp_m_freem(m_ack); - return (-1); + return; } chk->copy_by_ref = 0; /* figure out where it goes to */ @@ -8001,7 +8001,7 @@ sctp_send_asconf_ack(struct sctp_tcb *stcb, uint32_t retrans) atomic_add_int(&chk->whoTo->ref_count, 1); TAILQ_INSERT_TAIL(&chk->asoc->control_send_queue, chk, sctp_next); chk->asoc->ctrl_queue_cnt++; - return (0); + return; } @@ -8136,7 +8136,7 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, * We don't want to mark the net->sent time here since this * we use this for HB and retrans cannot measure RTT */ - /* SCTP_GETTIME_TIMEVAL(&chk->whoTo->last_sent_time); */ + /* (void)SCTP_GETTIME_TIMEVAL(&chk->whoTo->last_sent_time); */ *cnt_out += 1; chk->sent = SCTP_DATAGRAM_SENT; sctp_ucount_decr(asoc->sent_queue_retran_cnt); @@ -8376,12 +8376,12 @@ one_chunk_around: * since this we use this for HB and retrans cannot * measure RTT */ - /* SCTP_GETTIME_TIMEVAL(&net->last_sent_time); */ + /* (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); */ /* For auto-close */ cnt_thru++; if (*now_filled == 0) { - SCTP_GETTIME_TIMEVAL(&asoc->time_last_sent); + (void)SCTP_GETTIME_TIMEVAL(&asoc->time_last_sent); *now = asoc->time_last_sent; *now_filled = 1; } else { @@ -8522,7 +8522,7 @@ sctp_timer_validation(struct sctp_inpcb *inp, return (ret); } -int +void sctp_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_where) @@ -8568,7 +8568,7 @@ sctp_chunk_output(struct sctp_inpcb *inp, (TAILQ_EMPTY(&asoc->control_send_queue)) && (asoc->sent_queue_retran_cnt == 0)) { /* Nothing to do unless there is something to be sent left */ - return (error); + return; } /* * Do we have something to send, data or control AND a sack timer @@ -8592,7 +8592,7 @@ sctp_chunk_output(struct sctp_inpcb *inp, (void)sctp_med_chunk_output(inp, stcb, asoc, &num_out, &reason_code, 1, &cwnd_full, from_where, &now, &now_filled, frag_point); - return (0); + return; } else if (from_where != SCTP_OUTPUT_FROM_HB_TMR) { /* if its not from a HB then do it */ fr_done = 0; @@ -8620,7 +8620,8 @@ sctp_chunk_output(struct sctp_inpcb *inp, #ifdef SCTP_AUDITING_ENABLED sctp_auditing(8, inp, stcb, NULL); #endif - return (sctp_timer_validation(inp, stcb, asoc, ret)); + sctp_timer_validation(inp, stcb, asoc, ret); + return; } if (ret < 0) { /*- @@ -8631,7 +8632,7 @@ sctp_chunk_output(struct sctp_inpcb *inp, sctp_auditing(9, inp, stcb, NULL); #endif if (ret == SCTP_RETRAN_EXIT) { - return (-1); + return; } break; } @@ -8643,11 +8644,11 @@ sctp_chunk_output(struct sctp_inpcb *inp, /* Push out any control */ (void)sctp_med_chunk_output(inp, stcb, asoc, &num_out, &reason_code, 1, &cwnd_full, from_where, &now, &now_filled, frag_point); - return (ret); + return; } if (tot_frs > asoc->max_burst) { /* Hit FR burst limit */ - return (0); + return; } if ((num_out == 0) && (ret == 0)) { @@ -8794,7 +8795,7 @@ sctp_chunk_output(struct sctp_inpcb *inp, */ if (stcb->asoc.ecn_echo_cnt_onq) sctp_fix_ecn_echo(asoc); - return (error); + return; } @@ -9330,7 +9331,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr) SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } -int +void sctp_send_shutdown_complete(struct sctp_tcb *stcb, struct sctp_nets *net) { @@ -9341,7 +9342,7 @@ sctp_send_shutdown_complete(struct sctp_tcb *stcb, m_shutdown_comp = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_complete_msg), 0, M_DONTWAIT, 1, MT_HEADER); if (m_shutdown_comp == NULL) { /* no mbuf's */ - return (-1); + return; } comp_cp = mtod(m_shutdown_comp, struct sctp_shutdown_complete_msg *); comp_cp->shut_cmp.ch.chunk_type = SCTP_SHUTDOWN_COMPLETE; @@ -9357,10 +9358,10 @@ sctp_send_shutdown_complete(struct sctp_tcb *stcb, (struct sockaddr *)&net->ro._l_addr, m_shutdown_comp, 0, NULL, 1, 0, NULL, 0); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); - return (0); + return; } -int +void sctp_send_shutdown_complete2(struct mbuf *m, int iphlen, struct sctphdr *sh, uint32_t vrf_id, uint32_t table_id) { @@ -9378,7 +9379,7 @@ sctp_send_shutdown_complete2(struct mbuf *m, int iphlen, struct sctphdr *sh, mout = sctp_get_mbuf_for_msg(len, 1, M_DONTWAIT, 1, MT_DATA); if (mout == NULL) { - return (-1); + return; } SCTP_BUF_LEN(mout) = len; iph = mtod(m, struct ip *); @@ -9430,12 +9431,12 @@ sctp_send_shutdown_complete2(struct mbuf *m, int iphlen, struct sctphdr *sh, (caddr_t)ip6_out + offset_out); } else { /* Currently not supported. */ - return (-1); + return; } if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { /* no mbuf's */ sctp_m_freem(mout); - return (-1); + return; } /* Now copy in and fill in the ABORT tags etc. */ comp_cp->sh.src_port = sh->dest_port; @@ -9487,7 +9488,7 @@ sctp_send_shutdown_complete2(struct mbuf *m, int iphlen, struct sctphdr *sh, SCTP_STAT_INCR(sctps_sendpackets); SCTP_STAT_INCR_COUNTER64(sctps_outpackets); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); - return (0); + return; } @@ -9497,7 +9498,7 @@ sctp_select_hb_destination(struct sctp_tcb *stcb, struct timeval *now) struct sctp_nets *net, *hnet; int ms_goneby, highest_ms, state_overide = 0; - SCTP_GETTIME_TIMEVAL(now); + (void)SCTP_GETTIME_TIMEVAL(now); highest_ms = 0; hnet = NULL; SCTP_TCB_LOCK_ASSERT(stcb); @@ -9602,7 +9603,7 @@ sctp_send_hb(struct sctp_tcb *stcb, int user_req, struct sctp_nets *u_net) if (net == NULL) { return (0); } - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); } sin = (struct sockaddr_in *)&net->ro._l_addr; if (sin->sin_family != AF_INET) { @@ -10605,7 +10606,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, sp->ppid = srcv->sinfo_ppid; sp->context = srcv->sinfo_context; sp->strseq = 0; - SCTP_GETTIME_TIMEVAL(&sp->ts); + (void)SCTP_GETTIME_TIMEVAL(&sp->ts); sp->stream = srcv->sinfo_stream; sp->length = min(uio->uio_resid, max_send_len); @@ -10935,7 +10936,7 @@ sctp_lower_sosend(struct socket *so, queue_only = 1; asoc = &stcb->asoc; asoc->state = SCTP_STATE_COOKIE_WAIT; - SCTP_GETTIME_TIMEVAL(&asoc->time_entered); + (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); /* initialize authentication params for the assoc */ sctp_initialize_auth_params(inp, stcb); diff --git a/sys/netinet/sctp_output.h b/sys/netinet/sctp_output.h index 2f9b3441c482..27033a50ab0b 100644 --- a/sys/netinet/sctp_output.h +++ b/sys/netinet/sctp_output.h @@ -86,26 +86,27 @@ void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *); int sctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *, struct sctp_nets *); -int sctp_send_cookie_ack(struct sctp_tcb *); + +void sctp_send_cookie_ack(struct sctp_tcb *); void sctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int, struct sctp_nets *); -int sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *); +void sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *); -int sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *); +void sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *); -int sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *); +void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *); -int +void sctp_send_shutdown_complete2(struct mbuf *, int, struct sctphdr *, uint32_t, uint32_t); -int sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *); +void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *); -int sctp_send_asconf_ack(struct sctp_tcb *, uint32_t); +void sctp_send_asconf_ack(struct sctp_tcb *, uint32_t); int sctp_get_frag_point(struct sctp_tcb *, struct sctp_association *); @@ -124,7 +125,7 @@ sctp_insert_on_wheel(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_stream_out *strq, int holdslock); -int sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int); +void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int); void sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *); void send_forward_tsn(struct sctp_tcb *, struct sctp_association *); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 75af8b30e19d..c43342bfdb93 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -163,6 +163,7 @@ sctp_allocate_vrf(int vrf_id) #ifdef INVARIANTS panic("No memory for VRF:%d", vrf_id); #endif + SCTP_FREE(vrf); return (NULL); } vrf->vrf_ifn_hash = SCTP_HASH_INIT(SCTP_VRF_IFN_HASH_SIZE, @@ -172,6 +173,8 @@ sctp_allocate_vrf(int vrf_id) #ifdef INVARIANTS panic("No memory for VRF:%d", vrf_id); #endif + SCTP_HASH_FREE(vrf->vrf_addr_hash, vrf->vrf_addr_hashmark); + SCTP_FREE(vrf); return (NULL); } /* Add it to the hash table */ @@ -493,11 +496,11 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, struct sockaddr *addr, if (sctp_ifap) { sctp_ifap->localifa_flags &= SCTP_ADDR_VALID; sctp_ifap->localifa_flags |= SCTP_BEING_DELETED; - sctp_ifap->ifn_p->ifa_count--; vrf->total_ifa_count--; LIST_REMOVE(sctp_ifap, next_bucket); LIST_REMOVE(sctp_ifap, next_ifa); if (sctp_ifap->ifn_p) { + sctp_ifap->ifn_p->ifa_count--; if (SCTP_LIST_EMPTY(&sctp_ifap->ifn_p->ifalist)) { sctp_delete_ifn(sctp_ifap->ifn_p, 1); } @@ -1891,7 +1894,7 @@ sctp_inpcb_alloc(struct socket *so) m->size_of_a_cookie += SCTP_SIGNATURE_SIZE; /* Setup the initial secret */ - SCTP_GETTIME_TIMEVAL(&time); + (void)SCTP_GETTIME_TIMEVAL(&time); m->time_of_secret_change = time.tv_sec; for (i = 0; i < SCTP_NUMBER_OF_SECRETS; i++) { @@ -2770,7 +2773,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) } if (cnt) { /* Ok we have someone out there that will kill us */ - SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); + (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); @@ -2781,7 +2784,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) return; } if ((inp->refcount) || (inp->sctp_flags & SCTP_PCB_FLAGS_CLOSE_IP)) { - SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); + (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); sctp_timer_start(SCTP_TIMER_TYPE_INPKILL, inp, NULL, NULL); SCTP_INP_WUNLOCK(inp); SCTP_ASOC_CREATE_UNLOCK(inp); @@ -2792,7 +2795,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) #endif return; } - SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); + (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); inp->sctp_ep.signature_change.type = 0; inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_ALLGONE; @@ -2800,7 +2803,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) sctp_log_closing(inp, NULL, 5); #endif - SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); + (void)SCTP_OS_TIMER_STOP(&inp->sctp_ep.signature_change.timer); inp->sctp_ep.signature_change.type = SCTP_TIMER_TYPE_NONE; /* Clear the read queue */ while ((sq = TAILQ_FIRST(&inp->read_queue)) != NULL) { @@ -3082,7 +3085,7 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr, } SCTP_INCR_RADDR_COUNT(); bzero(net, sizeof(*net)); - SCTP_GETTIME_TIMEVAL(&net->start_time); + (void)SCTP_GETTIME_TIMEVAL(&net->start_time); memcpy(&net->ro._l_addr, newaddr, newaddr->sa_len); if (newaddr->sa_family == AF_INET) { ((struct sockaddr_in *)&net->ro._l_addr)->sin_port = stcb->rport; @@ -3339,12 +3342,12 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, #ifdef SCTP_DEBUG if (sctp_debug_on & SCTP_DEBUG_PCB3) { printf("Allocate an association for peer:"); - if (firstaddr) + if (firstaddr) { sctp_print_address(firstaddr); - else + printf("Port:%d\n", + ntohs(((struct sockaddr_in *)firstaddr)->sin_port)); + } else printf("None\n"); - printf("Port:%d\n", - ntohs(((struct sockaddr_in *)firstaddr)->sin_port)); } #endif /* SCTP_DEBUG */ if (firstaddr->sa_family == AF_INET) { @@ -3557,7 +3560,7 @@ sctp_add_vtag_to_timewait(struct sctp_inpcb *inp, uint32_t tag, uint32_t time) struct timeval now; int set, i; - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); chain = &sctppcbinfo.vtag_timewait[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = 0; if (!SCTP_LIST_EMPTY(chain)) { @@ -3712,11 +3715,11 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre } } /* now clean up any other timers */ - SCTP_OS_TIMER_STOP(&asoc->hb_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->hb_timer.timer); asoc->hb_timer.self = NULL; - SCTP_OS_TIMER_STOP(&asoc->dack_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->dack_timer.timer); asoc->dack_timer.self = NULL; - SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); /*- * For stream reset we don't blast this unless * it is a str-reset timer, it might be the @@ -3725,20 +3728,20 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre */ if (asoc->strreset_timer.type == SCTP_TIMER_TYPE_STRRESET) asoc->strreset_timer.self = NULL; - SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); asoc->asconf_timer.self = NULL; - SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); asoc->autoclose_timer.self = NULL; - SCTP_OS_TIMER_STOP(&asoc->shut_guard_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->shut_guard_timer.timer); asoc->shut_guard_timer.self = NULL; - SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); asoc->delayed_event_timer.self = NULL; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - SCTP_OS_TIMER_STOP(&net->fr_timer.timer); + (void)SCTP_OS_TIMER_STOP(&net->fr_timer.timer); net->fr_timer.self = NULL; - SCTP_OS_TIMER_STOP(&net->rxt_timer.timer); + (void)SCTP_OS_TIMER_STOP(&net->rxt_timer.timer); net->rxt_timer.self = NULL; - SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); + (void)SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); net->pmtu_timer.self = NULL; } /* Now the read queue needs to be cleaned up (only once) */ @@ -3899,19 +3902,19 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre /* * Now restop the timers to be sure - this is paranoia at is finest! */ - SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->hb_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->dack_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->shut_guard_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->hb_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->dack_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->shut_guard_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - SCTP_OS_TIMER_STOP(&net->fr_timer.timer); - SCTP_OS_TIMER_STOP(&net->rxt_timer.timer); - SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); + (void)SCTP_OS_TIMER_STOP(&net->fr_timer.timer); + (void)SCTP_OS_TIMER_STOP(&net->rxt_timer.timer); + (void)SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); } asoc->strreset_timer.type = SCTP_TIMER_TYPE_NONE; @@ -4584,7 +4587,7 @@ sctp_pcb_init() sctp_pcb_initialized = 1; bzero(&sctpstat, sizeof(struct sctpstat)); - SCTP_GETTIME_TIMEVAL(&sctpstat.sctps_discontinuitytime); + (void)SCTP_GETTIME_TIMEVAL(&sctpstat.sctps_discontinuitytime); /* init the empty list of (All) Endpoints */ LIST_INIT(&sctppcbinfo.listhead); @@ -4987,8 +4990,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, phdr = sctp_get_next_param(m, offset, (struct sctp_paramhdr *)&ai, sizeof(ai)); aip = (struct sctp_adaptation_layer_indication *)phdr; - sctp_ulp_notify(SCTP_NOTIFY_ADAPTATION_INDICATION, - stcb, ntohl(aip->indication), NULL); + if (aip) { + sctp_ulp_notify(SCTP_NOTIFY_ADAPTATION_INDICATION, + stcb, ntohl(aip->indication), NULL); + } } } else if (ptype == SCTP_SET_PRIM_ADDR) { struct sctp_asconf_addr_param lstore, *fee; @@ -5133,7 +5138,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, stcb->asoc.peer_hmacs = sctp_alloc_hmaclist(num_hmacs); if (stcb->asoc.peer_hmacs != NULL) { for (i = 0; i < num_hmacs; i++) { - sctp_auth_add_hmacid(stcb->asoc.peer_hmacs, + (void)sctp_auth_add_hmacid(stcb->asoc.peer_hmacs, ntohs(hmacs->hmac_ids[i])); } } @@ -5159,7 +5164,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, else stcb->asoc.peer_auth_chunks = sctp_alloc_chunklist(); for (i = 0; i < num_chunks; i++) { - sctp_auth_add_chunk(chunks->chunk_types[i], + (void)sctp_auth_add_chunk(chunks->chunk_types[i], stcb->asoc.peer_auth_chunks); } got_chklist = 1; @@ -5552,7 +5557,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, struct sctp_tcb *stcb) asoc->highest_tsn_inside_map = asoc->cumulative_tsn; } asoc->last_revoke_count = cnt; - SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); + (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); sctp_send_sack(stcb); sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_DRAIN); reneged_asoc_ids[reneged_at] = sctp_get_associd(stcb); diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 3e72cc000c0f..62c34bde0728 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -63,7 +63,7 @@ sctp_early_fr_timer(struct sctp_inpcb *inp, unsigned int cur_rtt, cnt = 0, cnt_resend = 0; /* an early FR is occuring. */ - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); /* get cur rto in micro-seconds */ if (net->lastsa == 0) { /* Hmm no rtt estimate yet? */ @@ -477,7 +477,7 @@ sctp_mark_all_for_resend(struct sctp_tcb *stcb, * figure out how long a data chunk must be pending before we can * mark it .. */ - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); /* get cur rto in micro-seconds */ cur_rtt = (((net->lastsa >> 2) + net->lastsv) >> 1); cur_rtt *= 1000; @@ -894,7 +894,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, struct timeval now; unsigned int ms_goneby; - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); if (net->last_sent_time.tv_sec) { ms_goneby = (now.tv_sec - net->last_sent_time.tv_sec) * 1000; } else { @@ -905,7 +905,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * no recent feed back in an RTO or * more, request a RTT update */ - sctp_send_hb(stcb, 1, net); + (void)sctp_send_hb(stcb, 1, net); } } } @@ -1576,7 +1576,7 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sctp_association *asoc; int ticks_gone_by; - SCTP_GETTIME_TIMEVAL(&tn); + (void)SCTP_GETTIME_TIMEVAL(&tn); if (stcb->asoc.sctp_autoclose_ticks && sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) { /* Auto close is on */ @@ -1661,7 +1661,7 @@ done_with_iterator: TAILQ_REMOVE(&sctppcbinfo.iteratorhead, it, sctp_nxt_itr); /* stopping the callout is not needed, in theory */ SCTP_INP_INFO_WUNLOCK(); - SCTP_OS_TIMER_STOP(&it->tmr.timer); + (void)SCTP_OS_TIMER_STOP(&it->tmr.timer); if (it->function_atend != NULL) { (*it->function_atend) (it->pointer, it->val); } diff --git a/sys/netinet/sctp_uio.h b/sys/netinet/sctp_uio.h index 240db62d139c..03df51307b0d 100644 --- a/sys/netinet/sctp_uio.h +++ b/sys/netinet/sctp_uio.h @@ -904,7 +904,7 @@ struct sctpstat { #define SCTP_STAT_INCR(_x) SCTP_STAT_INCR_BY(_x,1) #define SCTP_STAT_DECR(_x) SCTP_STAT_DECR_BY(_x,1) #define SCTP_STAT_INCR_BY(_x,_d) atomic_add_long(&sctpstat._x, _d) -#define SCTP_STAT_DECR_BY(_x,_d) atomic_add_long(&sctpstat._x, -(_d)) +#define SCTP_STAT_DECR_BY(_x,_d) atomic_subtract_long(&sctpstat._x, _d) /* The following macros are for handling MIB values, */ #define SCTP_STAT_INCR_COUNTER32(_x) SCTP_STAT_INCR(_x) #define SCTP_STAT_INCR_COUNTER64(_x) SCTP_STAT_INCR(_x) diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index a37da5c2336d..e0aa9eb72bf4 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -456,7 +456,7 @@ sctp_must_try_again: #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 16); #endif - sctp_inpcb_free(inp, 1, 0); + sctp_inpcb_free(inp, 1, 1); SOCK_LOCK(so); SCTP_SB_CLEAR(so->so_snd); /* @@ -521,7 +521,7 @@ sctp_attach(struct socket *so, int proto, struct thread *p) sctp_log_closing(inp, NULL, 15); #endif SCTP_INP_WUNLOCK(inp); - sctp_inpcb_free(inp, 1, 0); + sctp_inpcb_free(inp, 1, 1); } else { SCTP_INP_WUNLOCK(inp); } @@ -1354,7 +1354,7 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval, stcb->asoc.delayed_connection = 1; sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, stcb->asoc.primary_destination); } else { - SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); + (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); sctp_send_initiate(inp, stcb); } SCTP_TCB_UNLOCK(stcb); @@ -2814,7 +2814,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, } if (stcb->asoc.delayed_connection == 1) { stcb->asoc.delayed_connection = 0; - SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); + (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); sctp_timer_stop(SCTP_TIMER_TYPE_INIT, inp, stcb, stcb->asoc.primary_destination, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_9); @@ -3031,7 +3031,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, /************************NET SPECIFIC SET ******************/ if (paddrp->spp_flags & SPP_HB_DEMAND) { /* on demand HB */ - sctp_send_hb(stcb, 1, net); + (void)sctp_send_hb(stcb, 1, net); } if (paddrp->spp_flags & SPP_HB_DISABLE) { net->dest_state |= SCTP_ADDR_NOHB; @@ -3575,7 +3575,7 @@ sctp_connect(struct socket *so, struct sockaddr *addr, struct thread *p) soisconnecting(so); } stcb->asoc.state = SCTP_STATE_COOKIE_WAIT; - SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); + (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); /* initialize authentication parameters for the assoc */ sctp_initialize_auth_params(inp, stcb); diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h index ae68b23a89b9..a7a3f6b6d188 100644 --- a/sys/netinet/sctp_var.h +++ b/sys/netinet/sctp_var.h @@ -121,9 +121,9 @@ extern struct pr_usrreqs sctp_usrreqs; #define sctp_free_remote_addr(__net) { \ if ((__net)) { \ if (atomic_fetchadd_int(&(__net)->ref_count, -1) == 1) { \ - SCTP_OS_TIMER_STOP(&(__net)->rxt_timer.timer); \ - SCTP_OS_TIMER_STOP(&(__net)->pmtu_timer.timer); \ - SCTP_OS_TIMER_STOP(&(__net)->fr_timer.timer); \ + (void)SCTP_OS_TIMER_STOP(&(__net)->rxt_timer.timer); \ + (void)SCTP_OS_TIMER_STOP(&(__net)->pmtu_timer.timer); \ + (void)SCTP_OS_TIMER_STOP(&(__net)->fr_timer.timer); \ if ((__net)->ro.ro_rt) { \ RTFREE((__net)->ro.ro_rt); \ (__net)->ro.ro_rt = NULL; \ diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index c9b422e9baa5..44c8475e6ca8 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -796,15 +796,15 @@ sctp_stop_timers_for_shutdown(struct sctp_tcb *stcb) asoc = &stcb->asoc; - SCTP_OS_TIMER_STOP(&asoc->hb_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->dack_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); - SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->hb_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->dack_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->strreset_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->asconf_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->autoclose_timer.timer); + (void)SCTP_OS_TIMER_STOP(&asoc->delayed_event_timer.timer); TAILQ_FOREACH(net, &asoc->nets, sctp_next) { - SCTP_OS_TIMER_STOP(&net->fr_timer.timer); - SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); + (void)SCTP_OS_TIMER_STOP(&net->fr_timer.timer); + (void)SCTP_OS_TIMER_STOP(&net->pmtu_timer.timer); } } @@ -883,7 +883,7 @@ sctp_select_a_tag(struct sctp_inpcb *m) u_long x, not_done; struct timeval now; - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); not_done = 1; while (not_done) { x = sctp_select_initial_TSN(&m->sctp_ep); @@ -936,7 +936,7 @@ sctp_init_asoc(struct sctp_inpcb *m, struct sctp_association *asoc, if (override_tag) { struct timeval now; - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); if (sctp_is_vtag_good(m, override_tag, &now)) { asoc->my_vtag = override_tag; } else { @@ -1112,9 +1112,8 @@ sctp_init_asoc(struct sctp_inpcb *m, struct sctp_association *asoc, asoc->timoheartbeat = 0; asoc->timocookie = 0; asoc->timoshutdownack = 0; - SCTP_GETTIME_TIMEVAL(&asoc->start_time); - SCTP_GETTIME_TIMEVAL(&asoc->discontinuity_time); - + (void)SCTP_GETTIME_TIMEVAL(&asoc->start_time); + asoc->discontinuity_time = asoc->start_time; return (0); } @@ -1573,7 +1572,7 @@ sctp_timeout_handler(void *t) int i, secret; SCTP_STAT_INCR(sctps_timosecret); - SCTP_GETTIME_TIMEVAL(&tv); + (void)SCTP_GETTIME_TIMEVAL(&tv); SCTP_INP_WLOCK(inp); inp->sctp_ep.time_of_secret_change = tv.tv_sec; inp->sctp_ep.last_secret_number = @@ -2067,7 +2066,7 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, return (0); } -int +void sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t from) { @@ -2075,7 +2074,7 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, if ((t_type != SCTP_TIMER_TYPE_ADDR_WQ) && (inp == NULL)) - return (EFAULT); + return; tmr = NULL; if (stcb) { @@ -2087,7 +2086,7 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, break; case SCTP_TIMER_TYPE_EARLYFR: if ((stcb == NULL) || (net == NULL)) { - return (EFAULT); + return; } tmr = &net->fr_timer; SCTP_STAT_INCR(sctps_earlyfrstop); @@ -2102,37 +2101,37 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, break; case SCTP_TIMER_TYPE_SEND: if ((stcb == NULL) || (net == NULL)) { - return (EFAULT); + return; } tmr = &net->rxt_timer; break; case SCTP_TIMER_TYPE_INIT: if ((stcb == NULL) || (net == NULL)) { - return (EFAULT); + return; } tmr = &net->rxt_timer; break; case SCTP_TIMER_TYPE_RECV: if (stcb == NULL) { - return (EFAULT); + return; } tmr = &stcb->asoc.dack_timer; break; case SCTP_TIMER_TYPE_SHUTDOWN: if ((stcb == NULL) || (net == NULL)) { - return (EFAULT); + return; } tmr = &net->rxt_timer; break; case SCTP_TIMER_TYPE_HEARTBEAT: if (stcb == NULL) { - return (EFAULT); + return; } tmr = &stcb->asoc.hb_timer; break; case SCTP_TIMER_TYPE_COOKIE: if ((stcb == NULL) || (net == NULL)) { - return (EFAULT); + return; } tmr = &net->rxt_timer; break; @@ -2149,7 +2148,7 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, * Stop the asoc kill timer. */ if (stcb == NULL) { - return (EFAULT); + return; } tmr = &stcb->asoc.strreset_timer; break; @@ -2164,37 +2163,37 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, break; case SCTP_TIMER_TYPE_PATHMTURAISE: if ((stcb == NULL) || (net == NULL)) { - return (EFAULT); + return; } tmr = &net->pmtu_timer; break; case SCTP_TIMER_TYPE_SHUTDOWNACK: if ((stcb == NULL) || (net == NULL)) { - return (EFAULT); + return; } tmr = &net->rxt_timer; break; case SCTP_TIMER_TYPE_SHUTDOWNGUARD: if (stcb == NULL) { - return (EFAULT); + return; } tmr = &stcb->asoc.shut_guard_timer; break; case SCTP_TIMER_TYPE_STRRESET: if (stcb == NULL) { - return (EFAULT); + return; } tmr = &stcb->asoc.strreset_timer; break; case SCTP_TIMER_TYPE_ASCONF: if (stcb == NULL) { - return (EFAULT); + return; } tmr = &stcb->asoc.asconf_timer; break; case SCTP_TIMER_TYPE_AUTOCLOSE: if (stcb == NULL) { - return (EFAULT); + return; } tmr = &stcb->asoc.autoclose_timer; break; @@ -2208,7 +2207,7 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, break; }; if (tmr == NULL) { - return (EFAULT); + return; } if ((tmr->type != t_type) && tmr->type) { /* @@ -2217,7 +2216,7 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, * running the timer that the caller wants stopped. So just * return. */ - return (0); + return; } if (t_type == SCTP_TIMER_TYPE_SEND) { stcb->asoc.num_send_timers_up--; @@ -2227,8 +2226,8 @@ sctp_timer_stop(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, } tmr->self = NULL; tmr->stopped_from = from; - SCTP_OS_TIMER_STOP(&tmr->timer); - return (0); + (void)SCTP_OS_TIMER_STOP(&tmr->timer); + return; } #ifdef SCTP_USE_ADLER32 @@ -2477,7 +2476,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb, /* 1. calculate new RTT */ /************************/ /* get the current time */ - SCTP_GETTIME_TIMEVAL(&now); + (void)SCTP_GETTIME_TIMEVAL(&now); /* compute the RTT value */ if ((u_long)now.tv_sec > (u_long)old->tv_sec) { calc_time = ((u_long)now.tv_sec - (u_long)old->tv_sec) * 1000; diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h index 41a509219a41..43410fa31806 100644 --- a/sys/netinet/sctputil.h +++ b/sys/netinet/sctputil.h @@ -136,7 +136,7 @@ int sctp_timer_start(int, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *); -int +void sctp_timer_stop(int, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint32_t); diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index d9c0890a5818..9804571fa8ff 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -223,7 +223,7 @@ sctp_skip_csum: /* Length now holds the total packet length payload + iphlen */ length = ntohs(ip6->ip6_plen) + iphlen; - (void)sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, + sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, in6p, stcb, net, ecn_bits, vrf_id, table_id); /* inp's ref-count reduced && stcb unlocked */ /* XXX this stuff below gets moved to appropriate parts later... */ |