FIB path CLI fix for lookup-table IDs 89/14589/2
authorNeale Ranns <nranns@cisco.com>
Fri, 31 Aug 2018 07:11:19 +0000 (00:11 -0700)
committerDave Barach <openvpp@barachs.net>
Fri, 31 Aug 2018 11:59:16 +0000 (11:59 +0000)
Change-Id: I8c127d472e0010036061a8a076599d1ff85abab5
Signed-off-by: Neale Ranns <nranns@cisco.com>
src/vnet/fib/fib_types.c

index 0dda65e..a71f419 100644 (file)
@@ -527,6 +527,10 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args)
         {
             rpath->frp_proto = DPO_PROTO_IP4;
             *payload_proto = DPO_PROTO_IP4;
+            fi = fib_table_find (FIB_PROTOCOL_IP4, rpath->frp_fib_index);
+            if (~0 == fi)
+                return 0;
+            rpath->frp_fib_index = fi;
         }
         else if (unformat (input,
                            "ip6-lookup-in-table %d",
@@ -534,6 +538,10 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args)
         {
             rpath->frp_proto = DPO_PROTO_IP6;
             *payload_proto = DPO_PROTO_IP6;
+            fi = fib_table_find (FIB_PROTOCOL_IP6, rpath->frp_fib_index);
+            if (~0 == fi)
+                return 0;
+            rpath->frp_fib_index = fi;
         }
         else if (unformat (input,
                            "mpls-lookup-in-table %d",
@@ -541,6 +549,10 @@ unformat_fib_route_path (unformat_input_t * input, va_list * args)
         {
             rpath->frp_proto = DPO_PROTO_MPLS;
             *payload_proto = DPO_PROTO_MPLS;
+            fi = fib_table_find (FIB_PROTOCOL_MPLS, rpath->frp_fib_index);
+            if (~0 == fi)
+                return 0;
+            rpath->frp_fib_index = fi;
         }
         else if (unformat (input, "src-lookup"))
         {