]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: fix dangling pointer when exiting from the helper mode
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 9 Jun 2021 16:26:46 +0000 (19:26 +0300)
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>
ospfd/ospf_gr_helper.c

index 10c5020cd18c31660fe26e935c4b971b644ee45e..3a130f87fe1f6a659cd62a2eda00b4ec66160910 100644 (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 */