aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-06-07 09:18:26 -0400
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-08-18 19:47:21 +0000
commit3c450d3a3e8ed309596fb18c0685ee028d7f0d59 (patch)
tree29e11d9f66a89732552c48012f1ffae46bfeecf7
parent29e70a6eb1dd0de76be9e46c1488a3e7885e904b (diff)
mactime: print error if feature not enabled
Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I8fbc4baefecf512573126c5085ed7a6e2e360fbe (cherry picked from commit c1f0d9c105c25c67d9ef86a53c10d43d40b61fe0)
-rw-r--r--src/plugins/mactime/mactime.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/mactime/mactime.c b/src/plugins/mactime/mactime.c
index 57895404390..84aba5f72a4 100644
--- a/src/plugins/mactime/mactime.c
+++ b/src/plugins/mactime/mactime.c
@@ -513,6 +513,11 @@ show_mactime_command_fn (vlib_main_t * vm,
vlib_counter_t allow, drop;
ethernet_arp_ip4_entry_t *n, *pool;
+ if (mm->feature_initialized == 0)
+ return clib_error_return
+ (0,
+ "Feature not initialized, suggest 'help mactime enable-disable'...");
+
vec_reset_length (mm->arp_cache_copy);
pool = ip4_neighbors_pool ();
@@ -668,7 +673,9 @@ clear_mactime_command_fn (vlib_main_t * vm,
mactime_main_t *mm = &mactime_main;
if (mm->feature_initialized == 0)
- return clib_error_return (0, "feature not enabled");
+ return clib_error_return
+ (0,
+ "Feature not initialized, suggest 'help mactime enable-disable'...");
vlib_clear_combined_counters (&mm->allow_counters);
vlib_clear_combined_counters (&mm->drop_counters);