diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2021-04-30 15:26:08 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-08-18 09:29:04 -0400 |
| commit | 3b2d89b0a35b026b86d54b92ae0a2b20fffed85c (patch) | |
| tree | 4f1aa882c6e9084f9ddeffa31eb590e4353da4c6 /bgpd/rfapi/rfapi.c | |
| parent | 1f32eb30d96ae4c92ed8d03fe3aea95d962b59b1 (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/rfapi.c')
| -rw-r--r-- | bgpd/rfapi/rfapi.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index 2de9508e9d..d24a07cd8a 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -1238,24 +1238,7 @@ static int rfapi_open_inner(struct rfapi_descriptor *rfd, struct bgp *bgp, rfd->peer = peer_new(bgp); rfd->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 (&rfd->peer->connection.io_mtx) { - // we don't need any I/O related facilities - if (rfd->peer->connection.ibuf) - stream_fifo_free(rfd->peer->connection.ibuf); - if (rfd->peer->connection.obuf) - stream_fifo_free(rfd->peer->connection.obuf); - - if (rfd->peer->connection.ibuf_work) - ringbuf_del(rfd->peer->connection.ibuf_work); - - rfd->peer->connection.ibuf = NULL; - rfd->peer->connection.obuf = NULL; - rfd->peer->connection.ibuf_work = NULL; - } + bgp_peer_connection_buffers_free(&rfd->peer->connection); { /* base code assumes have valid host pointer */ char buf[INET6_ADDRSTRLEN]; |
