From 3b2d89b0a35b026b86d54b92ae0a2b20fffed85c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 30 Apr 2021 15:26:08 -0400 Subject: 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 --- bgpd/rfapi/vnc_zebra.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'bgpd/rfapi/vnc_zebra.c') 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 = -- cgit v1.2.3