summaryrefslogtreecommitdiff
path: root/zebra/zebra_nhg.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-06-18 12:07:23 +0300
committerDonatas Abraitis <donatas@opensourcerouting.org>2024-06-18 12:15:33 +0300
commitdbf83cfd36a2c7d32f26a95d6daa70cb2d6d16e7 (patch)
tree829492b414f8e50665f948c1c0386ecbeb5ba52e /zebra/zebra_nhg.c
parent83b4706f309a97a1cd6d43e4a028848e94029740 (diff)
zebra: Set the weight for non-recursive next-hop
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>
Diffstat (limited to 'zebra/zebra_nhg.c')
-rw-r--r--zebra/zebra_nhg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index 1246e4dba2..55920102bb 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -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: