From fcc89a9cfc9fbff3eacc66bdf38ca9dd0f0664f6 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Mon, 11 Mar 2019 10:46:25 -0400 Subject: [PATCH] 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 --- zebra/rt_netlink.c | 4 ++++ 1 file changed, 4 insertions(+) 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]); -- 2.39.5