summaryrefslogtreecommitdiff
path: root/ospfd/ospf_vty.c
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2023-07-20 15:22:03 +0000
committerAlexander Chernavin <achernavin@netgate.com>2023-07-25 15:50:16 +0000
commitf050e57a2c5de88ccc6c96346c5c99a8571929d6 (patch)
treedea5435fdf68554e75d66dc3e9b411a6c5fcd2e5 /ospfd/ospf_vty.c
parent3f043d027f29ec676b3abdc46397a863fbd73717 (diff)
ospfd: fix SPF calculation when changing ABR type
Currently, when changing ABR type on a working router, SPF recalculation will only be initiated if the OSPF flags have changed after this. Otherwise, SPF recalculation will be omitted and OSPF RIB update will not occur. In other words, changing ABR type might not result in inter-area routes addition/deletion. With this fix, when ABR type is changed, the command handler initiates SPF recalculation. Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r--ospfd/ospf_vty.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 1500d61b48..158e90df59 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -2058,6 +2058,13 @@ DEFUN (ospf_abr_type,
if (ospf->abr_type != abr_type) {
ospf->abr_type = abr_type;
ospf_schedule_abr_task(ospf);
+
+ /* The ABR task might not initiate SPF recalculation if the
+ * OSPF flags remain the same. And inter-area routes would not
+ * be added/deleted according to the new ABR type. So this
+ * needs to be done here too.
+ */
+ ospf_spf_calculate_schedule(ospf, SPF_FLAG_ABR_STATUS_CHANGE);
}
return CMD_SUCCESS;