]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: special handling for proto-NHG-based routes
authorStephen Worley <sworley@cumulusnetworks.com>
Sun, 10 May 2020 21:34:27 +0000 (17:34 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Mon, 28 Sep 2020 16:40:59 +0000 (12:40 -0400)
For now let's assume proto-NHG-based routes are good to go
(we assume they are onlink/interface based anyway) and bypass
route resolution altogether.

Once we determine how to handle recursive nexthop-resolution for
proto-NHGs we will revisit this.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/zebra_nhg.c

index 9c45093f21e995662800290782b9392a0544218d..617a3def6203e543e10cfa6511cda5d415facfcb 100644 (file)
@@ -2291,6 +2291,22 @@ static uint32_t nexthop_list_active_update(struct route_node *rn,
        return counter;
 }
 
+
+static uint32_t proto_nhg_nexthop_active_update(struct nexthop_group *nhg)
+{
+       struct nexthop *nh;
+       uint32_t curr_active = 0;
+
+       /* Assume all active for now */
+
+       for (nh = nhg->nexthop; nh; nh = nh->next) {
+               SET_FLAG(nh->flags, NEXTHOP_FLAG_ACTIVE);
+               curr_active++;
+       }
+
+       return curr_active;
+}
+
 /*
  * Iterate over all nexthops of the given RIB entry and refresh their
  * ACTIVE flag.  If any nexthop is found to toggle the ACTIVE flag,
@@ -2303,6 +2319,9 @@ int nexthop_active_update(struct route_node *rn, struct route_entry *re)
        struct nhg_hash_entry *curr_nhe;
        uint32_t curr_active = 0, backup_active = 0;
 
+       if (re->nhe->id >= zclient_get_nhg_lower_bound())
+               return proto_nhg_nexthop_active_update(&re->nhe->nhg);
+
        afi_t rt_afi = family2afi(rn->p.family);
 
        UNSET_FLAG(re->status, ROUTE_ENTRY_CHANGED);