ip6: fix ip6-local urpf checking 46/11446/3
authorFlorin Coras <fcoras@cisco.com>
Wed, 28 Mar 2018 09:18:29 +0000 (02:18 -0700)
committerChris Luke <chris_luke@comcast.com>
Thu, 29 Mar 2018 19:26:49 +0000 (19:26 +0000)
Use sw_if_index[VLIB_TX] if set as fib index when doing the urpf check.

Change-Id: I5ec3e7f7a54c6782704d91e9a5614fd0f7f9e3de
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/ip/ip6_forward.c
test/test_vcl.py

index 2c00111..88b21d5 100644 (file)
@@ -975,12 +975,15 @@ ip6_urpf_loose_check (ip6_main_t * im, vlib_buffer_t * b, ip6_header_t * i)
 {
   const load_balance_t *lb0;
   index_t lbi;
+  u32 fib_index;
 
-  lbi = ip6_fib_table_fwding_lookup_with_if_index (im,
-                                                  vnet_buffer
-                                                  (b)->sw_if_index[VLIB_RX],
-                                                  &i->src_address);
+  fib_index = vec_elt (im->fib_index_by_sw_if_index,
+                      vnet_buffer (b)->sw_if_index[VLIB_RX]);
+  fib_index =
+    (vnet_buffer (b)->sw_if_index[VLIB_TX] == (u32) ~ 0) ?
+    fib_index : vnet_buffer (b)->sw_if_index[VLIB_TX];
 
+  lbi = ip6_fib_table_fwding_lookup (im, fib_index, &i->src_address);
   lb0 = load_balance_get (lbi);
 
   return (fib_urpf_check_size (lb0->lb_urpf));
index c02f13f..593088f 100644 (file)
@@ -636,11 +636,9 @@ class VCLIpv6ThruHostStackTestCase(VCLTestCase):
     def test_vcl_ipv6_thru_host_stack_echo(self):
         """ run VCL IPv6 thru host stack echo test """
 
-        # TBD: Enable this when VPP IPv6 thru host teardown
-        # config bug is fixed.
-        # self.thru_host_stack_test("vcl_test_server", self.server_ipv6_args,
-        #                          "vcl_test_client",
-        #                          self.client_ipv6_echo_test_args)
+        self.thru_host_stack_test("vcl_test_server", self.server_ipv6_args,
+                                  "vcl_test_client",
+                                  self.client_ipv6_echo_test_args)
 
     # TBD: Remove VCLIpv6ThruHostStackExtended*TestCase classes and move
     #      tests here when VPP  thru host teardown/setup config bug