X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip%2Ficmp6.c;h=4bba430fadcbca047259fc4b2e7beb639eed523d;hb=282872127;hp=ff83a0cb94686794c23a1d66ee8baf2e6afa963d;hpb=da7f7b6164e976a97ff0afb13f488c60461402bc;p=vpp.git diff --git a/src/vnet/ip/icmp6.c b/src/vnet/ip/icmp6.c index ff83a0cb946..4bba430fadc 100644 --- a/src/vnet/ip/icmp6.c +++ b/src/vnet/ip/icmp6.c @@ -130,7 +130,7 @@ static char *icmp_error_strings[] = { typedef enum { - ICMP_INPUT_NEXT_DROP, + ICMP_INPUT_NEXT_PUNT, ICMP_INPUT_N_NEXT, } icmp_input_next_t; @@ -199,7 +199,7 @@ ip6_icmp_input (vlib_main_t * vm, next0 = im->input_next_index_by_type[type0]; error0 = - next0 == ICMP_INPUT_NEXT_DROP ? ICMP6_ERROR_UNKNOWN_TYPE : error0; + next0 == ICMP_INPUT_NEXT_PUNT ? ICMP6_ERROR_UNKNOWN_TYPE : error0; /* Check code is valid for type. */ error0 = @@ -223,7 +223,7 @@ ip6_icmp_input (vlib_main_t * vm, b0->error = node->errors[error0]; - next0 = error0 != ICMP6_ERROR_NONE ? ICMP_INPUT_NEXT_DROP : next0; + next0 = error0 != ICMP6_ERROR_NONE ? ICMP_INPUT_NEXT_PUNT : next0; vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, @@ -250,7 +250,7 @@ VLIB_REGISTER_NODE (ip6_icmp_input_node) = { .n_next_nodes = 1, .next_nodes = { - [ICMP_INPUT_NEXT_DROP] = "ip6-drop", + [ICMP_INPUT_NEXT_PUNT] = "ip6-punt", }, }; /* *INDENT-ON* */ @@ -512,7 +512,6 @@ ip6_icmp_error (vlib_main_t * vm, org_p0 = vlib_get_buffer (vm, org_pi0); p0 = vlib_buffer_copy_no_chain (vm, org_p0, &pi0); - vlib_buffer_free_one (vm, org_pi0); if (!p0 || pi0 == ~0) /* Out of buffers */ continue; @@ -588,6 +587,15 @@ ip6_icmp_error (vlib_main_t * vm, vlib_put_next_frame (vm, node, next_index, n_left_to_next); } + /* + * push the original buffers to error-drop, so that + * they can get the error counters handled, then freed + */ + vlib_buffer_enqueue_to_single_next (vm, node, + vlib_frame_vector_args (frame), + IP6_ICMP_ERROR_NEXT_DROP, + frame->n_vectors); + return frame->n_vectors; } @@ -776,7 +784,7 @@ icmp6_init (vlib_main_t * vm) #undef _ clib_memset (cm->input_next_index_by_type, - ICMP_INPUT_NEXT_DROP, sizeof (cm->input_next_index_by_type)); + ICMP_INPUT_NEXT_PUNT, sizeof (cm->input_next_index_by_type)); clib_memset (cm->max_valid_code_by_type, 0, sizeof (cm->max_valid_code_by_type)); @@ -808,7 +816,7 @@ icmp6_init (vlib_main_t * vm) icmp6_register_type (vm, ICMP6_echo_request, ip6_icmp_echo_request_node.index); - return vlib_call_init_function (vm, ip6_neighbor_init); + return (NULL); } VLIB_INIT_FUNCTION (icmp6_init);