summaryrefslogtreecommitdiff
path: root/ospfd/ospf_spf.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_spf.c')
-rw-r--r--ospfd/ospf_spf.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 1e0814764b..0164bfac67 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -905,7 +905,9 @@ static unsigned int ospf_nexthop_calculation(struct ospf_area *area,
* somehow.
*/
if (area->ospf->ti_lfa_enabled
- || (oi && oi->type == OSPF_IFTYPE_POINTOPOINT)) {
+ || (oi && oi->type == OSPF_IFTYPE_POINTOPOINT)
+ || (oi && oi->type == OSPF_IFTYPE_POINTOMULTIPOINT
+ && oi->address->prefixlen == IPV4_MAX_BITLEN)) {
struct ospf_neighbor *nbr_w = NULL;
/* Calculating node is root node, link
@@ -1987,3 +1989,27 @@ void ospf_spf_calculate_schedule(struct ospf *ospf, ospf_spf_reason_t reason)
thread_add_timer_msec(master, ospf_spf_calculate_schedule_worker, ospf,
delay, &ospf->t_spf_calc);
}
+
+/* Restart OSPF SPF algorithm*/
+void ospf_restart_spf(struct ospf *ospf)
+{
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug("%s: Restart SPF.", __PRETTY_FUNCTION__);
+
+ /* Handling inter area and intra area routes*/
+ if (ospf->new_table) {
+ ospf_route_delete(ospf, ospf->new_table);
+ ospf_route_table_free(ospf->new_table);
+ ospf->new_table = route_table_init();
+ }
+
+ /* Handling of TYPE-5 lsa(external routes) */
+ if (ospf->old_external_route) {
+ ospf_route_delete(ospf, ospf->old_external_route);
+ ospf_route_table_free(ospf->old_external_route);
+ ospf->old_external_route = route_table_init();
+ }
+
+ /* Trigger SPF */
+ ospf_spf_calculate_schedule(ospf, SPF_FLAG_CONFIG_CHANGE);
+}