From 4b3c4577024be8ebbfa8d36aada419070c2925be Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 31 May 2021 10:27:51 -0300 Subject: [PATCH] ospfd: fix dangling pointer when exiting from the helper mode When exiting from the helper mode for a given router after an unsuccessful graceful restart, removing the neighborship to that router straight away leads to a dangling pointer in the associated interface, which inevitably leads to a crash. To solve this problem, schedule the removal of the neighbor instead of removing it immediately. Signed-off-by: Renato Westphal --- ospfd/ospf_gr_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ospfd/ospf_gr_helper.c b/ospfd/ospf_gr_helper.c index 10c5020cd1..3a130f87fe 100644 --- a/ospfd/ospf_gr_helper.c +++ b/ospfd/ospf_gr_helper.c @@ -721,7 +721,7 @@ void ospf_gr_helper_exit(struct ospf_neighbor *nbr, zlog_debug( "%s, Failed GR exit, so bringing down the neighbour", __func__); - OSPF_NSM_EVENT_EXECUTE(nbr, NSM_KillNbr); + OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_KillNbr); } /*Recalculate the DR for the network segment */ -- 2.39.5