Skip to content

Commit

Permalink
zebra: More memory free up on shutdown
Browse files Browse the repository at this point in the history
a) nl_batch_tx_buf was not being freed
b) the mlag_fifo was not being freed
c) the vrf->ns_ctxt was not being freed

Signed-off-by: Donald Sharp <[email protected]>
  • Loading branch information
donaldsharp committed Nov 13, 2023
1 parent 150e3ea commit c416603
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zebra/kernel_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1924,8 +1924,11 @@ void kernel_terminate(struct zebra_ns *zns, bool complete)
/* During zebra shutdown, we need to leave the dataplane socket
* around until all work is done.
*/
if (complete)
if (complete) {
kernel_nlsock_fini(&zns->netlink_dplane_out);

XFREE(MTYPE_NL_BUF, nl_batch_tx_buf);
}
}

/*
Expand Down
2 changes: 2 additions & 0 deletions zebra/zebra_mlag.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,8 @@ void zebra_mlag_init(void)

void zebra_mlag_terminate(void)
{
stream_fifo_free(zrouter.mlag_info.mlag_fifo);
zrouter.mlag_info.mlag_fifo = NULL;
}


Expand Down
6 changes: 6 additions & 0 deletions zebra/zebra_vrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ static int zebra_vrf_delete(struct vrf *vrf)

otable_fini(&zvrf->other_tables);
XFREE(MTYPE_ZEBRA_VRF, zvrf);

if (vrf->ns_ctxt) {
ns_delete(vrf->ns_ctxt);
vrf->ns_ctxt = NULL;
}

vrf->info = NULL;

return 0;
Expand Down

0 comments on commit c416603

Please sign in to comment.