mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-28 11:50:21 +00:00
lib, zebra: Ensure that the ifp->node exists
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>
This commit is contained in:
parent
06504bea79
commit
46d725f76b
1
lib/if.c
1
lib/if.c
@ -1028,6 +1028,7 @@ void if_terminate(struct vrf *vrf)
|
||||
if (ifp->node) {
|
||||
ifp->node->info = NULL;
|
||||
route_unlock_node(ifp->node);
|
||||
ifp->node = NULL;
|
||||
}
|
||||
if_delete(&ifp);
|
||||
}
|
||||
|
@ -267,6 +267,9 @@ struct interface *if_link_per_ns(struct zebra_ns *ns, struct interface *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;
|
||||
|
Loading…
Reference in New Issue
Block a user