From 6cae47ed3806308903a8098e5bb725bd9ab51d44 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 29 Jan 2019 21:57:32 -0500 Subject: [PATCH] zebra: When the kernel passes up a onlink route respect those flags Read the onlink flag from the kernel for routes and pass them up and through to zebra so that we are consistent with what the kernel is telling us. Signed-off-by: Donald Sharp --- zebra/rt_netlink.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index ce2d25862d..f69df1da89 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -556,6 +556,9 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, parse_encap_mpls(tb[RTA_ENCAP], labels); } + if (rtm->rtm_flags & RTNH_F_ONLINK) + SET_FLAG(nh.flags, NEXTHOP_FLAG_ONLINK); + if (num_labels) nexthop_add_labels(&nh, ZEBRA_LSP_STATIC, num_labels, labels); @@ -663,6 +666,10 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, nexthop_add_labels(nh, ZEBRA_LSP_STATIC, num_labels, labels); + if (nh && (rtnh->rtnh_flags & RTNH_F_ONLINK)) + SET_FLAG(nh->flags, + NEXTHOP_FLAG_ONLINK); + if (rtnh->rtnh_len == 0) break; -- 2.39.5