On removal, ensure that the ifp->node is set to a null
pointer so that FRR does not use data after freed.
In addition ensure that the ifp->node exists before
attempting to free it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
if (ifp->node) {
ifp->node->info = NULL;
route_unlock_node(ifp->node);
+ ifp->node = NULL;
}
if_delete(&ifp);
}
/* Delete a VRF. This is called in vrf_terminate(). */
void if_unlink_per_ns(struct interface *ifp)
{
+ if (!ifp->node)
+ return;
+
ifp->node->info = NULL;
route_unlock_node(ifp->node);
ifp->node = NULL;