diff options
author | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-02-03 19:30:33 +0100 |
---|---|---|
committer | Olivier Dugeon <olivier.dugeon@orange.com> | 2018-02-03 19:30:33 +0100 |
commit | bcf4475ec3f3946a5b9b25d67077bc4cac504954 (patch) | |
tree | 802b43e50fcf74414cb906f9977f12e6ef6744e3 /ospfd/ospf_te.c | |
parent | OSPFd: Correct Extended Prefix LSA refresh (diff) | |
download | frr-bcf4475ec3f3946a5b9b25d67077bc4cac504954.tar.xz frr-bcf4475ec3f3946a5b9b25d67077bc4cac504954.zip |
OSPFd: Fix ospfd crash during CI
When preforming CI test, CLI command 'no router ospf' followed by a
'router ospf' is performed to clean up the previous configuration.
Ospfd crash when configuring 'netwoark area'.
This is due to opsf_opaque_term() introduce in previous commit that cause this
crash. It remove not only Opaque LSA but also the list through the call to
'list_delete_and_null()' function. Same take place in 'ospf_mpls_te_term()',
'ospf_router_info_term()' and 'ospf_ext_term()' function.
New set of 'ospf_XXX_finish()' has been introduced to solve this issue while
keeping the possiblity to terminate properly the Opaque LSA and remove MPLS
LFIB entries set by Segment Routing.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'ospfd/ospf_te.c')
-rw-r--r-- | ospfd/ospf_te.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c index e11e89346..ab395207b 100644 --- a/ospfd/ospf_te.c +++ b/ospfd/ospf_te.c @@ -147,17 +147,46 @@ static int ospf_mpls_te_register(enum inter_as_mode mode) return rc; } +static int ospf_mpls_te_unregister() +{ + u_int8_t scope; + + if (OspfMplsTE.inter_as == Off) + return 0; + + if (OspfMplsTE.inter_as == AS) + scope = OSPF_OPAQUE_AS_LSA; + else + scope = OSPF_OPAQUE_AREA_LSA; + + ospf_delete_opaque_functab(scope, OPAQUE_TYPE_INTER_AS_LSA); + + return 0; +} + void ospf_mpls_te_term(void) { list_delete_and_null(&OspfMplsTE.iflist); + ospf_delete_opaque_functab(OSPF_OPAQUE_AREA_LSA, + OPAQUE_TYPE_TRAFFIC_ENGINEERING_LSA); + OspfMplsTE.enabled = false; + ospf_mpls_te_unregister(); OspfMplsTE.inter_as = Off; return; } +void ospf_mpls_te_finish(void) +{ + // list_delete_all_node(OspfMplsTE.iflist); + + OspfMplsTE.enabled = false; + OspfMplsTE.inter_as = Off; +} + /*------------------------------------------------------------------------* * Followings are control functions for MPLS-TE parameters management. *------------------------------------------------------------------------*/ @@ -2392,6 +2421,9 @@ DEFUN (no_ospf_mpls_te_inter_as, ospf_mpls_te_lsa_schedule(lp, FLUSH_THIS_LSA); } + /* Deregister the Callbacks for Inter-AS suport */ + ospf_mpls_te_unregister(); + return CMD_SUCCESS; } |