Skip to content

Commit

Permalink
ospfd: install Type-7 when NSSA enabled after redistribution
Browse files Browse the repository at this point in the history
If NSSA is enabled before redistribution is configured, Type-7 LSA's
are installed. But if NSSA is enabled after redistribution is
configured, Type-7 LSAs are missing.

With this change, when NSSA is enabled, scan for external LSA's and
if they exist, install Type-7.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
  • Loading branch information
achernavin22 committed Sep 3, 2020
1 parent 310451b commit 0f32181
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions ospfd/ospf_abr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
24 changes: 24 additions & 0 deletions ospfd/ospf_asbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions ospfd/ospf_asbr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0f32181

Please sign in to comment.