diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2020-11-05 13:40:26 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2020-11-23 18:50:32 +0100 |
commit | e33b95b4bb0afa46b89c3335443a9c316436fc9c (patch) | |
tree | a4aa337e025facdc707577c3b050efe21e75cd18 /isisd | |
parent | Merge pull request #7565 from vishaldhingra/bgp_nb (diff) | |
download | frr-e33b95b4bb0afa46b89c3335443a9c316436fc9c.tar.xz frr-e33b95b4bb0afa46b89c3335443a9c316436fc9c.zip |
isisd: uninstall local routes that don't have any valid nexthop
Once the remote end of a connected link is shut down (or lose
its address), isisd will remove the corresponding route from its
RIB after SPF runs. A new route for the same destination should
be computed based on the local LSP, and that route by definition
doesn't have any nexthop. The problem is that, when isisd tries
to replace the old route by the new one, it fails because routes
without nexthops can't be installed. That causes the old invalid
route to remain in the RIB when it shouldn't. To fix this problem,
change the zebra interface code to uninstall a route whenever it
can't be installed (because it lacks nexthops) instead of doing
nothing in that case.
This change should fix occasional failures of the test_isis_sr_topo1
topotest.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_zebra.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index b9958a669..e33b8c628 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -263,8 +263,14 @@ void isis_zebra_route_add_route(struct isis *isis, struct prefix *prefix, struct zapi_route api; int count = 0; - if (zclient->sock < 0 || list_isempty(route_info->nexthops)) + if (zclient->sock < 0) + return; + + /* Uninstall the route if it doesn't have any valid nexthop. */ + if (list_isempty(route_info->nexthops)) { + isis_zebra_route_del_route(isis, prefix, src_p, route_info); return; + } memset(&api, 0, sizeof(api)); api.vrf_id = isis->vrf_id; |