summaryrefslogtreecommitdiff
path: root/bgpd/rfapi/vnc_zebra.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-04-30 15:26:08 -0400
committerDonald Sharp <sharpd@nvidia.com>2023-08-18 09:29:04 -0400
commit3b2d89b0a35b026b86d54b92ae0a2b20fffed85c (patch)
tree4f1aa882c6e9084f9ddeffa31eb590e4353da4c6 /bgpd/rfapi/vnc_zebra.c
parent1f32eb30d96ae4c92ed8d03fe3aea95d962b59b1 (diff)
bgpd: Create destructor function for `struct peer_connection`
Create a destructor function to free up memory associated with the io buffers. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/rfapi/vnc_zebra.c')
-rw-r--r--bgpd/rfapi/vnc_zebra.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c
index edbe2e9f31..8a30edce91 100644
--- a/bgpd/rfapi/vnc_zebra.c
+++ b/bgpd/rfapi/vnc_zebra.c
@@ -174,28 +174,8 @@ static void vnc_redistribute_add(struct prefix *p, uint32_t metric,
vncHD1VR.peer->status =
Established; /* keep bgp core happy */
- /*
- * since this peer is not on the I/O thread, this lock
- * is not strictly necessary, but serves as a reminder
- * to those who may meddle...
- */
- frr_with_mutex (&vncHD1VR.peer->connection.io_mtx) {
- // we don't need any I/O related facilities
- if (vncHD1VR.peer->connection.ibuf)
- stream_fifo_free(
- vncHD1VR.peer->connection.ibuf);
- if (vncHD1VR.peer->connection.obuf)
- stream_fifo_free(
- vncHD1VR.peer->connection.obuf);
-
- if (vncHD1VR.peer->connection.ibuf_work)
- ringbuf_del(vncHD1VR.peer->connection
- .ibuf_work);
-
- vncHD1VR.peer->connection.ibuf = NULL;
- vncHD1VR.peer->connection.obuf = NULL;
- vncHD1VR.peer->connection.ibuf_work = NULL;
- }
+ bgp_peer_connection_buffers_free(
+ &vncHD1VR.peer->connection);
/* base code assumes have valid host pointer */
vncHD1VR.peer->host =