From d0bfe25dead1d3dfdc18951f1b6d0023be9ac76c Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 5 Mar 2020 14:50:37 +0000 Subject: [PATCH 1/2] nhrpd: ignore zebra updates about our routes being deleted/added nhrp listens for route entries to be deleted, in case some new routes impact the current routes installed by nhrp. To prevent from unconfiguring nhrp shortcut route, just prevent nhrp routes to be processed. Signed-off-by: Philippe Guibert --- nhrpd/nhrp_route.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nhrpd/nhrp_route.c b/nhrpd/nhrp_route.c index a23ac34745..ddb69a1aca 100644 --- a/nhrpd/nhrp_route.c +++ b/nhrpd/nhrp_route.c @@ -199,6 +199,10 @@ int nhrp_route_read(ZAPI_CALLBACK_ARGS) if (CHECK_FLAG(api.message, ZAPI_MESSAGE_SRCPFX)) return 0; + /* ignore our routes */ + if (api.type == ZEBRA_ROUTE_NHRP) + return 0; + sockunion_family(&nexthop_addr) = AF_UNSPEC; if (CHECK_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP)) { api_nh = &api.nexthops[0]; From 34b2ac58c5cdde140f73ec4d66a31297140a57e9 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Wed, 19 Feb 2020 17:27:06 +0100 Subject: [PATCH 2/2] zebra: when override flag is set, do not forget to update nht this flag can be used when one routing daemon wants to force his route to be injected prioritary with other routes, including selected routes. for that, do not forget to update the new_selected pointer in the zebra nexthop tracking algorithm. Signed-off-by: Philippe Guibert --- zebra/zebra_rnh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 74c3ac3712..8d99ce840e 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -669,7 +669,8 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi, zebra_route_string(re->type)); continue; } - if (!CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED)) { + if (!CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED) && + !CHECK_FLAG(re->flags, ZEBRA_FLAG_FIB_OVERRIDE)) { if (IS_ZEBRA_DEBUG_NHT_DETAILED) zlog_debug( "\tRoute Entry %s !selected",