X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsctp%2Fsctp_input.c;h=4f6214501e2d34c5019846fb1e8d10885d797c8a;hb=9382673d93d94f10348d61b7e7e7375883f74f5e;hp=ff79840f9fb7e192472f1d51fd30d5523cafc1de;hpb=63777e599af8df1e6bf8c564c638d52007af47d0;p=vpp.git diff --git a/src/vnet/sctp/sctp_input.c b/src/vnet/sctp/sctp_input.c index ff79840f9fb..4f6214501e2 100644 --- a/src/vnet/sctp/sctp_input.c +++ b/src/vnet/sctp/sctp_input.c @@ -851,7 +851,7 @@ sctp_handle_cookie_echo (sctp_header_t * sctp_hdr, sctp_connection_t * sctp_conn, u8 idx, vlib_buffer_t * b0, u16 * next0) { - u32 now = sctp_time_now (); + u64 now = sctp_time_now (); sctp_cookie_echo_chunk_t *cookie_echo = (sctp_cookie_echo_chunk_t *) sctp_hdr; @@ -864,10 +864,11 @@ sctp_handle_cookie_echo (sctp_header_t * sctp_hdr, sctp_calculate_rto (sctp_conn, idx); - u32 creation_time = - clib_net_to_host_u32 (cookie_echo->cookie.creation_time); - u32 cookie_lifespan = + u64 creation_time = + clib_net_to_host_u64 (cookie_echo->cookie.creation_time); + u64 cookie_lifespan = clib_net_to_host_u32 (cookie_echo->cookie.cookie_lifespan); + if (now > creation_time + cookie_lifespan) { SCTP_DBG ("now (%u) > creation_time (%u) + cookie_lifespan (%u)", @@ -1060,7 +1061,7 @@ sctp46_rcv_phase_inline (vlib_main_t * vm, vlib_node_runtime_t * node, * hence we should never get to the "default" case below. */ default: - error0 = SCTP_ERROR_UNKOWN_CHUNK; + error0 = SCTP_ERROR_UNKNOWN_CHUNK; next0 = sctp_next_drop (is_ip4); goto drop; } @@ -1400,7 +1401,7 @@ sctp46_shutdown_phase_inline (vlib_main_t * vm, * hence we should never get to the "default" case below. */ default: - error0 = SCTP_ERROR_UNKOWN_CHUNK; + error0 = SCTP_ERROR_UNKNOWN_CHUNK; next0 = sctp_next_drop (is_ip4); goto drop; } @@ -1516,6 +1517,11 @@ sctp_handle_sack (sctp_selective_ack_chunk_t * sack_chunk, /* Check that the LOCALLY generated tag is being used by the REMOTE peer as the verification tag */ if (sctp_conn->local_tag != sack_chunk->sctp_hdr.verification_tag) { + SCTP_ADV_DBG + ("sctp_conn->local_tag != sack_chunk->sctp_hdr.verification_tag"); + + *next0 = sctp_next_drop (sctp_conn->sub_conn[idx].c_is_ip4); + return SCTP_ERROR_INVALID_TAG; } @@ -1709,7 +1715,7 @@ sctp46_listen_process_inline (vlib_main_t * vm, child_conn->sub_conn[SCTP_PRIMARY_PATH_IDX]. connection.c_index, sctp_chunk_to_string (chunk_type)); - error0 = SCTP_ERROR_UNKOWN_CHUNK; + error0 = SCTP_ERROR_UNKNOWN_CHUNK; next0 = sctp_next_drop (is_ip4); goto drop; } @@ -1917,7 +1923,7 @@ sctp46_established_phase_inline (vlib_main_t * vm, vlib_node_runtime_t * node, * hence we should never get to the "default" case below. */ default: - error0 = SCTP_ERROR_UNKOWN_CHUNK; + error0 = SCTP_ERROR_UNKNOWN_CHUNK; next0 = sctp_next_drop (is_ip4); goto done; } @@ -2188,7 +2194,7 @@ sctp46_input_dispatcher (vlib_main_t * vm, vlib_node_runtime_t * node, sctp_prepare_operation_error (sctp_conn, SCTP_PRIMARY_PATH_IDX, b0, UNRECOGNIZED_CHUNK_TYPE); - error0 = SCTP_ERROR_UNKOWN_CHUNK; + error0 = SCTP_ERROR_UNKNOWN_CHUNK; next0 = sctp_next_output (is_ip4); goto done; }