]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Install nexthop's weight for IPv4 routes with IPv6 next hops 6021/head
authorvivek <vivek@cumulusnetworks.com>
Wed, 18 Mar 2020 02:25:13 +0000 (19:25 -0700)
committervivek <vivek@cumulusnetworks.com>
Wed, 18 Mar 2020 02:25:13 +0000 (19:25 -0700)
Ensure that any weight associated with the next hop is installed for
IPv4 routes with IPv6 next hops too.
Updates: lib, zebra: Allow for installation of a weighted nexthop

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
zebra/rt_netlink.c

index e40bf45f59b36fd837dd441e4827d35afeb238aa..2cc520bbce6651aa8a96b2d60e4eb5828ff323af 100644 (file)
@@ -1340,6 +1340,8 @@ static void _netlink_route_build_multipath(const char *routedesc, int bytelen,
                              bytelen);
                rtnh->rtnh_len += sizeof(struct rtattr) + bytelen;
                rtnh->rtnh_ifindex = nexthop->ifindex;
+               if (nexthop->weight)
+                       rtnh->rtnh_hops = nexthop->weight - 1;
 
                if (nexthop->rmap_src.ipv4.s_addr != INADDR_ANY)
                        *src = &nexthop->rmap_src;