fib: fix adjacency cli command issue
[vpp.git] / src / vnet / adj / adj.c
index a603925..c601e6b 100644 (file)
@@ -182,7 +182,7 @@ format_ip_adjacency (u8 * s, va_list * args)
         s = format (s, "\n   flags:%U", format_adj_flags, adj->ia_flags);
         s = format (s, "\n   counts:[%Ld:%Ld]", counts.packets, counts.bytes);
        s = format (s, "\n   locks:%d", adj->ia_node.fn_locks);
-       s = format(s, "\n delegates:\n  ");
+       s = format(s, "\n delegates:");
         s = adj_delegate_format(s, adj);
 
        s = format(s, "\n children:");
@@ -249,7 +249,7 @@ adj_last_lock_gone (ip_adjacency_t *adj)
     switch (adj->lookup_next_index)
     {
     case IP_LOOKUP_NEXT_MIDCHAIN:
-        dpo_reset(&adj->sub_type.midchain.next_dpo);
+        adj_midchain_teardown(adj);
         /* FALL THROUGH */
     case IP_LOOKUP_NEXT_ARP:
     case IP_LOOKUP_NEXT_REWRITE:
@@ -267,8 +267,10 @@ adj_last_lock_gone (ip_adjacency_t *adj)
        adj_glean_remove(adj->ia_nh_proto,
                         adj->rewrite_header.sw_if_index);
        break;
-    case IP_LOOKUP_NEXT_MCAST:
     case IP_LOOKUP_NEXT_MCAST_MIDCHAIN:
+        adj_midchain_teardown(adj);
+        /* FALL THROUGH */
+    case IP_LOOKUP_NEXT_MCAST:
        adj_mcast_remove(adj->ia_nh_proto,
                         adj->rewrite_header.sw_if_index);
        break;
@@ -611,9 +613,7 @@ adj_show (vlib_main_t * vm,
     {
        if (unformat (input, "%d", &ai))
            ;
-       else if (unformat (input, "sum"))
-           summary = 1;
-       else if (unformat (input, "summary"))
+       else if (unformat (input, "summary") || unformat (input, "sum"))
            summary = 1;
        else if (unformat (input, "%U",
                           unformat_vnet_sw_interface, vnet_get_main(),