mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-02 17:36:36 +00:00
bgpd: Expose bgp_peer_connection_free and make it a double pointer
The bgp_peer_connection_free function should be exposed outside of bgpd.c so that it can be used. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
d2ba78929f
commit
8e90c4c953
14
bgpd/bgpd.c
14
bgpd/bgpd.c
@ -1149,13 +1149,15 @@ void bgp_peer_connection_buffers_free(struct peer_connection *connection)
|
||||
}
|
||||
}
|
||||
|
||||
static void bgp_peer_connection_free(struct peer_connection *connection)
|
||||
void bgp_peer_connection_free(struct peer_connection **connection)
|
||||
{
|
||||
bgp_peer_connection_buffers_free(connection);
|
||||
pthread_mutex_destroy(&connection->io_mtx);
|
||||
bgp_peer_connection_buffers_free(*connection);
|
||||
pthread_mutex_destroy(&(*connection)->io_mtx);
|
||||
|
||||
memset(connection, 0, sizeof(struct peer_connection));
|
||||
XFREE(MTYPE_BGP_PEER_CONNECTION, connection);
|
||||
memset(*connection, 0, sizeof(struct peer_connection));
|
||||
XFREE(MTYPE_BGP_PEER_CONNECTION, *connection);
|
||||
|
||||
connection = NULL;
|
||||
}
|
||||
|
||||
struct peer_connection *bgp_peer_connection_new(struct peer *peer)
|
||||
@ -1268,7 +1270,7 @@ static void peer_free(struct peer *peer)
|
||||
if (peer->as_pretty)
|
||||
XFREE(MTYPE_BGP, peer->as_pretty);
|
||||
|
||||
bgp_peer_connection_free(peer->connection);
|
||||
bgp_peer_connection_free(&peer->connection);
|
||||
|
||||
bgp_unlock(peer->bgp);
|
||||
|
||||
|
@ -1162,6 +1162,7 @@ struct peer_connection {
|
||||
#define PEER_THREAD_READS_ON (1U << 1)
|
||||
};
|
||||
extern struct peer_connection *bgp_peer_connection_new(struct peer *peer);
|
||||
extern void bgp_peer_connection_free(struct peer_connection **connection);
|
||||
extern void bgp_peer_connection_buffers_free(struct peer_connection *connection);
|
||||
|
||||
/* BGP neighbor structure. */
|
||||
|
Loading…
Reference in New Issue
Block a user