aboutsummaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/node.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/vlib/vlib/node.c b/vlib/vlib/node.c
index 40ef7c71a51..573b3a79567 100644
--- a/vlib/vlib/node.c
+++ b/vlib/vlib/node.c
@@ -177,10 +177,9 @@ 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: slot must match. */
- if (slot != ~0)
- ASSERT (slot == p[0]);
- return p[0];
+ /* Next already exists: use it if slot not specified or the same. */
+ if ((slot == ~0) || (slot == p[0]))
+ return p[0];
}
if (slot == ~0)
@@ -190,7 +189,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;
- hash_set (node->next_slot_by_node, next_node_index, slot);
+ if (!p) hash_set (node->next_slot_by_node, next_node_index, slot);
vlib_node_runtime_update (vm, node_index, slot);