From: Stephen Worley Date: Mon, 11 Mar 2019 14:46:25 +0000 (-0400) Subject: zebra: Parse in nexthop ID information from new routes X-Git-Tag: base_7.3~219^2~149 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=fcc89a9cfc9fbff3eacc66bdf38ca9dd0f0664f6;p=mirror%2Ffrr.git zebra: Parse in nexthop ID information from new routes Add parsing code for nexthop object ID's when we get a route. When we get a new route with the new kernel, it will come with a nexthop ID and the nexthop full info. We should just reference by ID if it exists and point to the nexthop hash entry that matches it. Signed-off-by: Stephen Worley --- diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 98138d607b..03d1ee424c 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -342,6 +342,7 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, uint32_t mtu = 0; uint8_t distance = 0; route_tag_t tag = 0; + uint32_t nhe_id = 0; void *dest = NULL; void *gate = NULL; @@ -446,6 +447,9 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, if (tb[RTA_GATEWAY]) gate = RTA_DATA(tb[RTA_GATEWAY]); + if (tb[RTA_NH_ID]) + nhe_id = *(uint32_t *)RTA_DATA(tb[RTA_NH_ID]); + if (tb[RTA_PRIORITY]) metric = *(int *)RTA_DATA(tb[RTA_PRIORITY]);