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 <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2021-05-31 10:27:51 -03:00
parent f5f27b588a
commit 4b3c457702

View File

@ -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 */