From 15cc6a83f1369d77955bc5cb2d398f43f8100e69 Mon Sep 17 00:00:00 2001 From: Marco Varlese Date: Wed, 21 Feb 2018 12:39:52 +0100 Subject: SCTP: minor refactor This patch adds some missing information in various debugging messages which can help with debugging state-machine and connection-tracking. It also renames some internal variable names for better code readibility. Change-Id: I68503fc0214300032f7514426c8b5b2b12edf11a Signed-off-by: Marco Varlese --- src/vnet/sctp/sctp_input.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/vnet/sctp/sctp_input.c') diff --git a/src/vnet/sctp/sctp_input.c b/src/vnet/sctp/sctp_input.c index 35218d5dd62..d3e69c68ba0 100644 --- a/src/vnet/sctp/sctp_input.c +++ b/src/vnet/sctp/sctp_input.c @@ -537,8 +537,6 @@ sctp_handle_init_ack (sctp_header_t * sctp_hdr, sctp_timer_set (sctp_conn, idx, SCTP_TIMER_T1_COOKIE, sctp_conn->sub_conn[idx].RTO); - stream_session_accept_notify (&sctp_conn->sub_conn[idx].connection); - return SCTP_ERROR_NONE; } @@ -806,6 +804,8 @@ sctp_handle_cookie_echo (sctp_header_t * sctp_hdr, sctp_timer_set (sctp_conn, idx, SCTP_TIMER_T4_HEARTBEAT, sctp_conn->sub_conn[idx].RTO); + stream_session_accept_notify (&sctp_conn->sub_conn[idx].connection); + return SCTP_ERROR_NONE; } @@ -834,6 +834,8 @@ sctp_handle_cookie_ack (sctp_header_t * sctp_hdr, sctp_timer_set (sctp_conn, idx, SCTP_TIMER_T4_HEARTBEAT, sctp_conn->sub_conn[idx].RTO); + stream_session_accept_notify (&sctp_conn->sub_conn[idx].connection); + return SCTP_ERROR_NONE; } @@ -2084,10 +2086,13 @@ sctp46_input_dispatcher (vlib_main_t * vm, vlib_node_runtime_t * node, error0 = tm->dispatch_table[sctp_conn->state][chunk_type].error; SCTP_DBG_STATE_MACHINE - ("SESSION_INDEX = %u, CURRENT_CONNECTION_STATE = %s," + ("S_INDEX = %u, C_INDEX = %u, TRANS_CONN = %p, SCTP_CONN = %p, CURRENT_CONNECTION_STATE = %s," "CHUNK_TYPE_RECEIVED = %s " "NEXT_PHASE = %s", sctp_conn->sub_conn[MAIN_SCTP_SUB_CONN_IDX]. - connection.s_index, sctp_state_to_string (sctp_conn->state), + connection.s_index, + sctp_conn->sub_conn[MAIN_SCTP_SUB_CONN_IDX]. + connection.c_index, trans_conn, sctp_conn, + sctp_state_to_string (sctp_conn->state), sctp_chunk_to_string (chunk_type), phase_to_string (next0)); if (chunk_type == DATA) -- cgit 1.2.3-korg