diff options
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/unix/cli.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vlib/unix/cli.c b/src/vlib/unix/cli.c index 6c98867253f..44ec11fdb35 100644 --- a/src/vlib/unix/cli.c +++ b/src/vlib/unix/cli.c @@ -2863,6 +2863,7 @@ unix_cli_file_add (unix_cli_main_t * cm, char *name, int fd) { unix_main_t *um = &unix_main; clib_file_main_t *fm = &file_main; + vlib_node_main_t *nm = &vlib_get_main ()->node_main; unix_cli_file_t *cf; clib_file_t template = { 0 }; vlib_main_t *vm = um->vlib_main; @@ -2896,10 +2897,12 @@ unix_cli_file_add (unix_cli_main_t * cm, char *name, int fd) old_name = n->name; n->name = (u8 *) name; } + ASSERT (old_name); + hash_unset (nm->node_by_name, old_name); + hash_set (nm->node_by_name, name, n->index); vec_free (old_name); vlib_node_set_state (vm, n->index, VLIB_NODE_STATE_POLLING); - _vec_len (cm->unused_cli_process_node_indices) = l - 1; } else |