summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-02-10 13:12:58 -0500
committerMark Stapp <mjs@voltanet.io>2020-04-27 10:24:55 -0400
commita126f120039dd27485c17843087486019923ca80 (patch)
treef9091ee8b7325bafeab315d522c6866ee683f1a8
parent37a816b3a10fd19c63da41a4291492171bed7766 (diff)
zebra: fix handling of failed route install via notification
An async route notification can indicate that installation has failed, but the handling code wasn't dealing with that possibility correctly. Signed-off-by: Mark Stapp <mjs@voltanet.io>
-rw-r--r--zebra/zebra_rib.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 2dbe907751..b979de9ab7 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1334,19 +1334,15 @@ static bool rib_update_re_from_ctx(struct route_entry *re,
* we use the fib-specific nexthop-group to record the actual FIB
* status.
*/
+ matched = false;
+ ctxnhg = dplane_ctx_get_ng(ctx);
/* Check both fib group and notif group for equivalence.
*
* Let's assume the nexthops are ordered here to save time.
*/
- if (nexthop_group_equal(&re->fib_ng, dplane_ctx_get_ng(ctx)) == false) {
- if (IS_ZEBRA_DEBUG_RIB_DETAILED)
- zlog_debug(
- "%s(%u):%s update_from_ctx: notif nh and fib nh mismatch",
- VRF_LOGNAME(vrf), re->vrf_id, dest_str);
-
- matched = false;
- } else
+ if (re->fib_ng.nexthop && ctxnhg->nexthop &&
+ nexthop_group_equal(&re->fib_ng, ctxnhg))
matched = true;
/* If the new FIB set matches the existing FIB set, we're done. */
@@ -1387,7 +1383,7 @@ static bool rib_update_re_from_ctx(struct route_entry *re,
*/
matched = true;
- ctx_nexthop = dplane_ctx_get_ng(ctx)->nexthop;
+ ctx_nexthop = ctxnhg->nexthop;
/* Nothing installed - we can skip some of the checking/comparison
* of nexthops.
@@ -1471,8 +1467,6 @@ no_nexthops:
VRF_LOGNAME(vrf), re->vrf_id, dest_str,
(changed_p ? "true" : "false"));
- ctxnhg = dplane_ctx_get_ng(ctx);
-
if (ctxnhg->nexthop)
copy_nexthops(&(re->fib_ng.nexthop), ctxnhg->nexthop, NULL);
else {