summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_ri.c
diff options
context:
space:
mode:
authorOlivier Dugeon <olivier.dugeon@orange.com>2018-02-03 19:30:33 +0100
committerOlivier Dugeon <olivier.dugeon@orange.com>2018-02-03 19:30:33 +0100
commitbcf4475ec3f3946a5b9b25d67077bc4cac504954 (patch)
tree802b43e50fcf74414cb906f9977f12e6ef6744e3 /ospfd/ospf_ri.c
parentOSPFd: Correct Extended Prefix LSA refresh (diff)
downloadfrr-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_ri.c')
-rw-r--r--ospfd/ospf_ri.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c
index 647234c58..a1d20fdd6 100644
--- a/ospfd/ospf_ri.c
+++ b/ospfd/ospf_ri.c
@@ -198,6 +198,23 @@ static int ospf_router_info_register(u_int8_t scope)
return rc;
}
+static int ospf_router_info_unregister()
+{
+
+ if ((OspfRI.scope != OSPF_OPAQUE_AS_LSA)
+ && (OspfRI.scope != OSPF_OPAQUE_AREA_LSA)) {
+ zlog_warn(
+ "Unable to unregister Router Info functions: Wrong scope!");
+ return -1;
+ }
+
+ ospf_delete_opaque_functab(OspfRI.scope,
+ OPAQUE_TYPE_ROUTER_INFORMATION_LSA);
+
+ OspfRI.registered = 0;
+ return 0;
+}
+
void ospf_router_info_term(void)
{
@@ -206,9 +223,19 @@ void ospf_router_info_term(void)
OspfRI.enabled = false;
+ ospf_router_info_unregister();
+
return;
}
+void ospf_router_info_finish(void)
+{
+ list_delete_all_node(OspfRI.pce_info.pce_domain);
+ list_delete_all_node(OspfRI.pce_info.pce_neighbor);
+
+ OspfRI.enabled = false;
+}
+
static void del_pce_info(void *val)
{
XFREE(MTYPE_OSPF_PCE_PARAMS, val);