mactime: print error if feature not enabled

Type: fix

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I8fbc4baefecf512573126c5085ed7a6e2e360fbe
(cherry picked from commit c1f0d9c105)
This commit is contained in:
Dave Barach
2020-06-07 09:18:26 -04:00
committed by Andrew Yourtchenko
parent 29e70a6eb1
commit 3c450d3a3e

View File

@ -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);