ip: fix ip-local errors 22/24922/5
authorFlorin Coras <fcoras@cisco.com>
Tue, 11 Feb 2020 03:01:19 +0000 (03:01 +0000)
committerDave Barach <openvpp@barachs.net>
Tue, 11 Feb 2020 15:49:46 +0000 (15:49 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie8bc5c9a03e858487cf565b4e9b520e6b496337a

src/vnet/ip/ip4.h
src/vnet/ip/ip4_forward.c
src/vnet/ip/ip4_input.h
test/test_gre.py

index a7e05a4..bed552b 100644 (file)
@@ -178,6 +178,7 @@ typedef struct ip4_main_t
 
 /** Global ip4 main structure. */
 extern ip4_main_t ip4_main;
+extern char *ip4_error_strings[];
 
 /** Global ip4 input node.  Errors get attached to ip4 input node. */
 extern vlib_node_registration_t ip4_input_node;
index 40ae51c..95db931 100644 (file)
@@ -1696,7 +1696,7 @@ ip4_local_inline (vlib_main_t * vm,
 {
   u32 *from, n_left_from;
   vlib_node_runtime_t *error_node =
-    vlib_node_get_runtime (vm, ip4_input_node.index);
+    vlib_node_get_runtime (vm, ip4_local_node.index);
   u16 nexts[VLIB_FRAME_SIZE], *next;
   vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
   ip4_header_t *ip[2];
@@ -1825,6 +1825,8 @@ VLIB_REGISTER_NODE (ip4_local_node) =
   .name = "ip4-local",
   .vector_size = sizeof (u32),
   .format_trace = format_ip4_forward_next_trace,
+  .n_errors = IP4_N_ERROR,
+  .error_strings = ip4_error_strings,
   .n_next_nodes = IP_LOCAL_N_NEXT,
   .next_nodes =
   {
index 5df2154..383ef31 100644 (file)
@@ -43,8 +43,6 @@
 #include <vnet/ip/ip.h>
 #include <vnet/ethernet/ethernet.h>
 
-extern char *ip4_error_strings[];
-
 typedef enum
 {
   IP4_INPUT_NEXT_DROP,
index c604378..386d5da 100644 (file)
@@ -48,7 +48,7 @@ class TestGREInputNodes(VppTestCase):
         self.pg_start()
         # no tunnel created, gre-input not registered
         err = self.statistics.get_counter(
-            '/err/ip4-input/unknown ip protocol')[0]
+            '/err/ip4-local/unknown ip protocol')[0]
         self.assertEqual(err, 1)
         err_count = err
 
@@ -60,7 +60,7 @@ class TestGREInputNodes(VppTestCase):
         self.pg_start()
         # tunnel created, gre-input registered
         err = self.statistics.get_counter(
-            '/err/ip4-input/unknown ip protocol')[0]
+            '/err/ip4-local/unknown ip protocol')[0]
         # expect no new errors
         self.assertEqual(err, err_count)