fib: fix `show ip fib memory` output error 61/41861/2
authorJay Wang <jay.wang2@arm.com>
Tue, 12 Nov 2024 10:20:39 +0000 (10:20 +0000)
committerNeale Ranns <neale@graphiant.com>
Thu, 21 Nov 2024 20:53:36 +0000 (20:53 +0000)
Put `memory` before `mem` when parsing `show ip fib` CLI command to
avoid the following annoying output error.

vpp# show ip fib memory
ipv4-VRF:0 mtrie:343808 hash:4687
totals: mtrie:343808 hash:4687 all:348495
unknown input `ory'

Type: fix
Signed-off-by: Jay Wang <jay.wang2@arm.com>
Change-Id: I5f990243309d6e6ea339e8442f5e68ae90a98814

src/vnet/fib/ip4_fib.c

index 23f70a7..b119856 100644 (file)
@@ -354,8 +354,7 @@ ip4_show_fib (vlib_main_t * vm,
        else if (unformat (input, "mtrie"))
            mtrie = 1;
 
-        else if (unformat (input, "mem") ||
-                 unformat (input, "memory"))
+        else if (unformat (input, "memory") || unformat (input, "mem"))
            memory = 1;
 
        else if (unformat (input, "%U/%d",
@@ -620,7 +619,7 @@ ip4_show_fib (vlib_main_t * vm,
  ?*/
 VLIB_CLI_COMMAND (ip4_show_fib_command, static) = {
     .path = "show ip fib",
-    .short_help = "show ip fib [summary] [table <table-id>] [index <fib-id>] [<ip4-addr>[/<mask>]] [mtrie] [detail]",
+    .short_help = "show ip fib [summary] [table <table-id>] [index <fib-id>] [<ip4-addr>[/<mask>]] [mtrie] [detail] [memory]",
     .function = ip4_show_fib,
 };