VPP-889: MAP Stats API/CLI crashes when no domains.
[vpp.git] / src / vnet / map / map.c
index d246f6c..fa13588 100644 (file)
@@ -1106,7 +1106,10 @@ show_map_stats_command_fn (vlib_main_t * vm, unformat_input_t * input,
   map_domain_t *d;
   int domains = 0, rules = 0, domaincount = 0, rulecount = 0;
   if (pool_elts (mm->domains) == 0)
-    vlib_cli_output (vm, "No MAP domains are configured...");
+    {
+      vlib_cli_output (vm, "No MAP domains are configured...");
+      return 0;
+    }
 
   /* *INDENT-OFF* */
   pool_foreach(d, mm->domains, ({