diff options
author | Vijayabhaskar Katamreddy <vkatamre@cisco.com> | 2017-11-15 13:50:26 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-12-15 15:58:46 +0000 |
commit | ce07412a54f06900b377a7f4966f6a26e19b8f2b (patch) | |
tree | 860d792f497e71e09c899b13bd744512c43a9563 /src/vnet/ip/punt.c | |
parent | 0e789423bb0d447c9d0ef62e1379d01f78939b8a (diff) |
Fix icmp/udp/tcp punt/drop paths
Send packets to ip4/6_punt/drop nodes instead of error-drop/punt nodes
dbarach: clean up an annoying checkstyle issue: indent 2.2.10
(OpenSUSE version) and indent 2.2.11 (Ubuntu / CentOS versions) had an
artistic disagreement about ip_frag.c.
Change-Id: I660bee28a064af9c6c70371363081e941d1c3a94
Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/ip/punt.c')
-rw-r--r-- | src/vnet/ip/punt.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vnet/ip/punt.c b/src/vnet/ip/punt.c index 568350cda82..b417427288c 100644 --- a/src/vnet/ip/punt.c +++ b/src/vnet/ip/punt.c @@ -40,7 +40,8 @@ #include <stdbool.h> #define foreach_punt_next \ - _ (PUNT, "error-punt") + _ (PUNT4, "ip4-punt") \ + _ (PUNT6, "ip6-punt") typedef enum { @@ -58,6 +59,8 @@ enum punt_socket_rx_next_e PUNT_SOCKET_RX_N_NEXT }; +#define punt_next_punt(is_ip4) (is_ip4 ? PUNT_NEXT_PUNT4 : PUNT_NEXT_PUNT6) + vlib_node_registration_t udp4_punt_node; vlib_node_registration_t udp6_punt_node; vlib_node_registration_t udp4_punt_socket_node; @@ -104,7 +107,8 @@ udp46_punt_inline (vlib_main_t * vm, { u32 n_left_to_next; - vlib_get_next_frame (vm, node, PUNT_NEXT_PUNT, to_next, n_left_to_next); + vlib_get_next_frame (vm, node, punt_next_punt (is_ip4), to_next, + n_left_to_next); while (n_left_from > 0 && n_left_to_next > 0) { @@ -123,7 +127,7 @@ udp46_punt_inline (vlib_main_t * vm, b0->error = node->errors[PUNT_ERROR_UDP_PORT]; } - vlib_put_next_frame (vm, node, PUNT_NEXT_PUNT, n_left_to_next); + vlib_put_next_frame (vm, node, punt_next_punt (is_ip4), n_left_to_next); } return from_frame->n_vectors; |