mfib CLI bugs (VPP-852) 83/6783/2
authorNeale Ranns <nranns@cisco.com>
Fri, 19 May 2017 09:54:32 +0000 (02:54 -0700)
committerFlorin Coras <florin.coras@gmail.com>
Fri, 19 May 2017 17:42:28 +0000 (17:42 +0000)
Change-Id: I1b71010e20742eee02693d672e24c85897e37759
Signed-off-by: Neale Ranns <nranns@cisco.com>
src/vnet/ip/lookup.c
src/vnet/mfib/ip4_mfib.c
src/vnet/mfib/ip6_mfib.c

index b9b5caa..6547cad 100755 (executable)
@@ -813,12 +813,14 @@ vnet_ip_mroute_cmd (vlib_main_t * vm,
                         unformat_ip4_address,
                         &pfx.fp_grp_addr.ip4, &pfx.fp_len))
        {
+         memset (&pfx.fp_src_addr.ip4, 0, sizeof (pfx.fp_src_addr.ip4));
          pfx.fp_proto = FIB_PROTOCOL_IP4;
        }
       else if (unformat (line_input, "%U/%d",
                         unformat_ip6_address,
                         &pfx.fp_grp_addr.ip6, &pfx.fp_len))
        {
+         memset (&pfx.fp_src_addr.ip6, 0, sizeof (pfx.fp_src_addr.ip6));
          pfx.fp_proto = FIB_PROTOCOL_IP6;
        }
       else if (unformat (line_input, "%U",
index 3ed7cba..1849a3a 100644 (file)
@@ -382,14 +382,17 @@ ip4_show_mfib (vlib_main_t * vm,
             matching = 1;
             mask = 64;
         }
+        else if (unformat (input, "%U/%d", unformat_ip4_address, &grp, &mask))
+        {
+            memset(&src, 0, sizeof(src));
+            matching = 1;
+        }
         else if (unformat (input, "%U", unformat_ip4_address, &grp))
         {
+            memset(&src, 0, sizeof(src));
             matching = 1;
             mask = 32;
         }
-        else if (unformat (input, "%U/%d",
-                           unformat_ip4_address, &grp, &mask))
-            matching = 1;
         else if (unformat (input, "table %d", &table_id))
             ;
         else if (unformat (input, "index %d", &fib_index))
index 116fee2..5c6f812 100644 (file)
@@ -585,16 +585,19 @@ ip6_show_mfib (vlib_main_t * vm,
                            unformat_ip6_address, &grp))
         {
             matching = 1;
-            mask = 64;
+            mask = 256;
         }
-        else if (unformat (input, "%U", unformat_ip6_address, &grp))
+        else if (unformat (input, "%U/%d", unformat_ip6_address, &grp, &mask))
         {
+            memset(&src, 0, sizeof(src));
             matching = 1;
-            mask = 32;
         }
-        else if (unformat (input, "%U/%d",
-                           unformat_ip6_address, &grp, &mask))
+        else if (unformat (input, "%U", unformat_ip6_address, &grp))
+        {
+            memset(&src, 0, sizeof(src));
             matching = 1;
+            mask = 128;
+        }
         else if (unformat (input, "table %d", &table_id))
             ;
         else if (unformat (input, "index %d", &fib_index))