]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Set the weight for non-recursive next-hop
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 18 Jun 2024 09:07:23 +0000 (12:07 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 18 Jun 2024 09:15:33 +0000 (12:15 +0300)
If using weighted ECMP, the weight for non-recursive next-hop should be
inherited from recursive next-hop.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
zebra/zebra_nhg.c

index 1246e4dba22bb981934f2579f2d347734e74b005..55920102bb0ac7f1efa00770fe47b0874e24d13e 100644 (file)
@@ -1747,6 +1747,12 @@ static struct nexthop *nexthop_set_resolved(afi_t afi,
        SET_FLAG(resolved_hop->flags, NEXTHOP_FLAG_ACTIVE);
 
        resolved_hop->vrf_id = nexthop->vrf_id;
+
+       /* Using weighted ECMP, we should respect the weight and use
+        * the same value for non-recursive next-hop.
+        */
+       resolved_hop->weight = nexthop->weight;
+
        switch (newhop->type) {
        case NEXTHOP_TYPE_IPV4:
        case NEXTHOP_TYPE_IPV4_IFINDEX: