summaryrefslogtreecommitdiffstats
path: root/vpp
diff options
context:
space:
mode:
Diffstat (limited to 'vpp')
-rw-r--r--vpp/app/vpe_cli.c3
-rw-r--r--vpp/vpp-api/api.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/vpp/app/vpe_cli.c b/vpp/app/vpe_cli.c
index 3b24c26f..38bf843d 100644
--- a/vpp/app/vpe_cli.c
+++ b/vpp/app/vpe_cli.c
@@ -72,8 +72,7 @@ virtual_ip_cmd_fn_command_fn (vlib_main_t * vm,
format_unformat_error, input);
}
}
- if (vec_len (mac_addrs) == 0 ||
- vec_len (next_hops) == 0 || vec_len (mac_addrs) != vec_len (next_hops))
+ if (vec_len (mac_addrs) == 0 || vec_len (mac_addrs) != vec_len (next_hops))
goto barf;
/* Create / delete special interface route /32's */
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c
index 84e4d5d5..3840b820 100644
--- a/vpp/vpp-api/api.c
+++ b/vpp/vpp-api/api.c
@@ -1597,6 +1597,14 @@ static void
/* Detect the set of worker threads */
uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers");
+
+ if (p == 0)
+ {
+ clib_warning ("worker thread registration AWOL !!");
+ rv = VNET_API_ERROR_INVALID_VALUE_2;
+ goto done;
+ }
+
vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0];
int worker_thread_first = tr->first_index;
int worker_thread_count = tr->count;