diff options
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_route.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/isisd/isis_route.c b/isisd/isis_route.c index b04e8e455..a91ce7eea 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -459,6 +459,21 @@ void isis_route_delete(struct isis_area *area, struct route_node *rode, route_unlock_node(rode); } +static void isis_route_remove_previous_sid(struct isis_area *area, + struct prefix *prefix, + struct isis_route_info *route_info) +{ + /* + * Explicitly uninstall previous Prefix-SID label if it has + * changed or was removed. + */ + if (route_info->sr_previous.present && + (!route_info->sr.present || + route_info->sr_previous.label != route_info->sr.label)) + isis_zebra_prefix_sid_uninstall(area, prefix, route_info, + &route_info->sr_previous); +} + static void isis_route_update(struct isis_area *area, struct prefix *prefix, struct prefix_ipv6 *src_p, struct isis_route_info *route_info) @@ -467,17 +482,7 @@ static void isis_route_update(struct isis_area *area, struct prefix *prefix, if (CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED)) return; - /* - * Explicitly uninstall previous Prefix-SID label if it has - * changed or was removed. - */ - if (route_info->sr_previous.present - && (!route_info->sr.present - || route_info->sr_previous.label - != route_info->sr.label)) - isis_zebra_prefix_sid_uninstall( - area, prefix, route_info, - &route_info->sr_previous); + isis_route_remove_previous_sid(area, prefix, route_info); /* Install route. */ isis_zebra_route_add_route(area->isis, prefix, src_p, @@ -765,6 +770,7 @@ void isis_route_switchover_nexthop(struct isis_area *area, (const struct prefix **)&src_p); /* Switchover route. */ + isis_route_remove_previous_sid(area, prefix, rinfo); UNSET_FLAG(rinfo->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED); isis_route_update(area, prefix, src_p, rinfo->backup); |