session: generate wrong thread errors instead of crashing
[vpp.git] / src / vnet / sctp / sctp_input.c
index c58da9e..88e4eab 100644 (file)
@@ -304,7 +304,7 @@ sctp_handle_operation_err (sctp_header_t * sctp_hdr,
        {
          sctp_connection_cleanup (sctp_conn);
 
-         stream_session_disconnect_notify (&sctp_conn->
+         session_transport_closing_notify (&sctp_conn->
                                            sub_conn[idx].connection);
        }
     }
@@ -1295,7 +1295,7 @@ sctp_handle_shutdown_complete (sctp_header_t * sctp_hdr,
 
   sctp_timer_reset (sctp_conn, idx, SCTP_TIMER_T2_SHUTDOWN);
 
-  stream_session_disconnect_notify (&sctp_conn->sub_conn[idx].connection);
+  session_transport_closing_notify (&sctp_conn->sub_conn[idx].connection);
 
   sctp_conn->state = SCTP_STATE_CLOSED;
 
@@ -2114,7 +2114,7 @@ sctp46_input_dispatcher (vlib_main_t * vm, vlib_node_runtime_t * node,
 {
   u32 n_left_from, next_index, *from, *to_next;
   u32 my_thread_index = vm->thread_index;
-  u8 is_filtered;
+  u8 result;
   sctp_main_t *tm = vnet_get_sctp_main ();
 
   from = vlib_frame_vector_args (from_frame);
@@ -2175,7 +2175,7 @@ sctp46_input_dispatcher (vlib_main_t * vm, vlib_node_runtime_t * node,
                                                          sctp_hdr->src_port,
                                                          TRANSPORT_PROTO_SCTP,
                                                          my_thread_index,
-                                                         &is_filtered);
+                                                         &result);
            }
          else
            {
@@ -2198,7 +2198,7 @@ sctp46_input_dispatcher (vlib_main_t * vm, vlib_node_runtime_t * node,
                                                          sctp_hdr->src_port,
                                                          TRANSPORT_PROTO_SCTP,
                                                          my_thread_index,
-                                                         &is_filtered);
+                                                         &result);
            }
 
          /* Length check */
@@ -2256,10 +2256,10 @@ sctp46_input_dispatcher (vlib_main_t * vm, vlib_node_runtime_t * node,
            }
          else
            {
-             if (is_filtered)
+             if (result)
                {
                  next0 = SCTP_INPUT_NEXT_DROP;
-                 error0 = SCTP_ERROR_FILTERED;
+                 error0 = SCTP_ERROR_NONE + result;
                }
              else if ((is_ip4 && tm->punt_unknown4) ||
                       (!is_ip4 && tm->punt_unknown6))