zebra: Check depends for validity, not dependents

When determining whether to set the nhg_hash_entry as
invalid, we should have been checking the depends, not
the dependents. If its a group and at least one of its
depends is valid, the group is still valid.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
Stephen Worley 2019-10-23 14:08:12 -04:00
parent 5a935f79d5
commit 0b4dadb385

View File

@ -1081,8 +1081,7 @@ void zebra_nhg_set_invalid(struct nhg_hash_entry *nhe)
struct nhg_connected *rb_node_dep = NULL; struct nhg_connected *rb_node_dep = NULL;
/* If anthing else in the group is valid, the group is valid */ /* If anthing else in the group is valid, the group is valid */
frr_each(nhg_connected_tree, &nhe->nhg_dependents, frr_each(nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
rb_node_dep) {
if (CHECK_FLAG(rb_node_dep->nhe->flags, if (CHECK_FLAG(rb_node_dep->nhe->flags,
NEXTHOP_GROUP_VALID)) NEXTHOP_GROUP_VALID))
return; return;