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>
diff --git a/src/vnet/ip/punt.c b/src/vnet/ip/punt.c
index 568350c..b417427 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 @@
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 @@
{
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 @@
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;