diff options
| author | kiselev99@gmail.com <kiselev99@gmail.com> | 2022-02-10 18:47:20 +0300 |
|---|---|---|
| committer | kiselev99@gmail.com <kiselev99@gmail.com> | 2022-02-10 19:16:33 +0300 |
| commit | eca3256db8eaea0315d01f48b1037e918be629be (patch) | |
| tree | 07f7e22f17e207366afa73d19f30d29177c18858 | |
| parent | 70d79c359b321337c3791944ef068917b24748b6 (diff) | |
zebra: FPM next hop weights
Don't lose next hop weights while exporting via FPM
Signed-off-by: Alex Kiselev <alex@bisonrouter.com>
| -rw-r--r-- | zebra/zebra_fpm_netlink.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c index 168e36ac9b..ec22c5dd48 100644 --- a/zebra/zebra_fpm_netlink.c +++ b/zebra/zebra_fpm_netlink.c @@ -116,6 +116,8 @@ struct fpm_nh_encap_info_t { * data structures for convenience. */ struct netlink_nh_info { + /* Weight of the nexthop ( for unequal cost ECMP ) */ + uint8_t weight; uint32_t if_index; union g_addr *gateway; @@ -179,6 +181,7 @@ static int netlink_route_info_add_nh(struct netlink_route_info *ri, nhi.recursive = nexthop->rparent ? 1 : 0; nhi.type = nexthop->type; nhi.if_index = nexthop->ifindex; + nhi.weight = nexthop->weight; if (nexthop->type == NEXTHOP_TYPE_IPV4 || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) { @@ -480,6 +483,8 @@ static int netlink_route_info_encode(struct netlink_route_info *ri, rtnh->rtnh_ifindex = nhi->if_index; } + rtnh->rtnh_hops = nhi->weight; + encap = nhi->encap_info.encap_type; switch (encap) { case FPM_NH_ENCAP_NONE: |
