mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 13:41:46 +00:00
zebra: On shutdown cleanup zns memory.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
01af05fbd5
commit
d3adb8a8f6
@ -42,11 +42,6 @@ struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id)
|
|||||||
return (info == NULL) ? dzns : info;
|
return (info == NULL) ? dzns : info;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct zebra_ns *zebra_ns_alloc(void)
|
|
||||||
{
|
|
||||||
return XCALLOC(MTYPE_ZEBRA_NS, sizeof(struct zebra_ns));
|
|
||||||
}
|
|
||||||
|
|
||||||
static int zebra_ns_new(struct ns *ns)
|
static int zebra_ns_new(struct ns *ns)
|
||||||
{
|
{
|
||||||
struct zebra_ns *zns;
|
struct zebra_ns *zns;
|
||||||
@ -57,7 +52,7 @@ static int zebra_ns_new(struct ns *ns)
|
|||||||
if (IS_ZEBRA_DEBUG_EVENT)
|
if (IS_ZEBRA_DEBUG_EVENT)
|
||||||
zlog_info("ZNS %s with id %u (created)", ns->name, ns->ns_id);
|
zlog_info("ZNS %s with id %u (created)", ns->name, ns->ns_id);
|
||||||
|
|
||||||
zns = zebra_ns_alloc();
|
zns = XCALLOC(MTYPE_ZEBRA_NS, sizeof(struct zebra_ns));
|
||||||
ns->info = zns;
|
ns->info = zns;
|
||||||
zns->ns = ns;
|
zns->ns = ns;
|
||||||
zns->ns_id = ns->ns_id;
|
zns->ns_id = ns->ns_id;
|
||||||
@ -194,6 +189,8 @@ int zebra_ns_final_shutdown(struct ns *ns,
|
|||||||
|
|
||||||
kernel_terminate(zns, true);
|
kernel_terminate(zns, true);
|
||||||
|
|
||||||
|
zebra_ns_delete(ns);
|
||||||
|
|
||||||
return NS_WALK_CONTINUE;
|
return NS_WALK_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user