summaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/node.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/vlib/vlib/node.c b/vlib/vlib/node.c
index 1df786f0c89..7378701ab4d 100644
--- a/vlib/vlib/node.c
+++ b/vlib/vlib/node.c
@@ -177,9 +177,10 @@ vlib_node_add_next_with_slot (vlib_main_t * vm,
if ((p = hash_get (node->next_slot_by_node, next_node_index)))
{
- /* Next already exists: use it if slot not specified or the same. */
- if ((slot == ~0) || (slot == p[0]))
- return p[0];
+ /* Next already exists: slot must match. */
+ if (slot != ~0)
+ ASSERT (slot == p[0]);
+ return p[0];
}
if (slot == ~0)
@@ -189,7 +190,7 @@ vlib_node_add_next_with_slot (vlib_main_t * vm,
vec_validate (node->n_vectors_by_next_node, slot);
node->next_nodes[slot] = next_node_index;
- if (!p) hash_set (node->next_slot_by_node, next_node_index, slot);
+ hash_set (node->next_slot_by_node, next_node_index, slot);
vlib_node_runtime_update (vm, node_index, slot);