aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/map/map.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2017-06-26 18:12:37 +0200
committerOle Trøan <otroan@employees.org>2017-06-26 17:53:10 +0000
commite2547ab574a82c69482704ef27375f1391deb9af (patch)
tree2b245a734aedc2fa31f6505e02e39d42c5561d54 /src/vnet/map/map.c
parent272351a2d41a7c6edefd384e9ddaf0b97ef92ffb (diff)
VPP-889: MAP Stats API/CLI crashes when no domains.
Change-Id: Ib7824bfc08cb3c8f20258379e1a1f2c159c4f687 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet/map/map.c')
-rw-r--r--src/vnet/map/map.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/map/map.c b/src/vnet/map/map.c
index d246f6c8254..fa13588fe38 100644
--- a/src/vnet/map/map.c
+++ b/src/vnet/map/map.c
@@ -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, ({