diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c index 3dbc476172e8..f6c050499903 100644 --- a/ospfd/ospf_abr.c +++ b/ospfd/ospf_abr.c @@ -1802,6 +1802,7 @@ static int ospf_abr_task_timer(struct thread *thread) ospf_abr_task(ospf); ospf_abr_nssa_task(ospf); /* if nssa-abr, then scan Type-7 LSDB */ + ospf_asbr_nssa_redist_task(ospf); return 0; } diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c index 1480b0e3914b..8fb6402c7e95 100644 --- a/ospfd/ospf_asbr.c +++ b/ospfd/ospf_asbr.c @@ -275,6 +275,30 @@ void ospf_asbr_status_update(struct ospf *ospf, uint8_t status) ospf_router_lsa_update(ospf); } +/* If there's redistribution configured, we need to refresh external + * LSAs in order to install Type-7 and flood to all NSSA Areas + */ +void ospf_asbr_nssa_redist_task(struct ospf *ospf) +{ + int type; + + for (type = 0; type < ZEBRA_ROUTE_MAX; type++) { + struct list *red_list; + struct listnode *node; + struct ospf_redist *red; + + red_list = ospf->redist[type]; + if (!red_list) + continue; + + for (ALL_LIST_ELEMENTS_RO(red_list, node, red)) + ospf_external_lsa_refresh_type( + ospf, type, red->instance, LSA_REFRESH_FORCE); + } + + ospf_external_lsa_refresh_default(ospf); +} + void ospf_redistribute_withdraw(struct ospf *ospf, uint8_t type, unsigned short instance) { diff --git a/ospfd/ospf_asbr.h b/ospfd/ospf_asbr.h index 1bcc32e3d825..ede6c479063c 100644 --- a/ospfd/ospf_asbr.h +++ b/ospfd/ospf_asbr.h @@ -72,6 +72,7 @@ extern struct external_info *ospf_external_info_lookup(struct ospf *, uint8_t, unsigned short, struct prefix_ipv4 *); extern void ospf_asbr_status_update(struct ospf *, uint8_t); +extern void ospf_asbr_nssa_redist_task(struct ospf *ospf); extern void ospf_redistribute_withdraw(struct ospf *, uint8_t, unsigned short); extern void ospf_asbr_check(void);