bgpd: Remove peer->sync array

It is never used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit c81d6d4d5f)
This commit is contained in:
Donald Sharp 2023-07-21 12:41:35 -04:00 committed by Mergify
parent 25f3e01dbb
commit a0b9010536
6 changed files with 0 additions and 36 deletions

View File

@ -219,29 +219,3 @@ bool bgp_adj_in_unset(struct bgp_dest *dest, struct peer *peer,
return true;
}
void bgp_sync_init(struct peer *peer)
{
afi_t afi;
safi_t safi;
struct bgp_synchronize *sync;
FOREACH_AFI_SAFI (afi, safi) {
sync = XCALLOC(MTYPE_BGP_SYNCHRONISE,
sizeof(struct bgp_synchronize));
bgp_adv_fifo_init(&sync->update);
bgp_adv_fifo_init(&sync->withdraw);
bgp_adv_fifo_init(&sync->withdraw_low);
peer->sync[afi][safi] = sync;
}
}
void bgp_sync_delete(struct peer *peer)
{
afi_t afi;
safi_t safi;
FOREACH_AFI_SAFI (afi, safi) {
XFREE(MTYPE_BGP_SYNCHRONISE, peer->sync[afi][safi]);
}
}

View File

@ -135,8 +135,6 @@ extern bool bgp_adj_in_unset(struct bgp_dest *dest, struct peer *peer,
uint32_t addpath_id);
extern void bgp_adj_in_remove(struct bgp_dest *dest, struct bgp_adj_in *bai);
extern void bgp_sync_init(struct peer *peer);
extern void bgp_sync_delete(struct peer *peer);
extern unsigned int bgp_advertise_attr_hash_key(const void *p);
extern bool bgp_advertise_attr_hash_cmp(const void *p1, const void *p2);
extern void bgp_advertise_add(struct bgp_advertise_attr *baa,

View File

@ -1172,8 +1172,6 @@ static void peer_free(struct peer *peer)
if (peer->clear_node_queue)
work_queue_free_and_null(&peer->clear_node_queue);
bgp_sync_delete(peer);
XFREE(MTYPE_PEER_CONF_IF, peer->conf_if);
XFREE(MTYPE_BGP_SOFT_VERSION, peer->soft_version);
@ -1418,8 +1416,6 @@ struct peer *peer_new(struct bgp *bgp)
peer->ibuf_work =
ringbuf_new(BGP_MAX_PACKET_SIZE * BGP_READ_PACKET_MAX);
bgp_sync_init(peer);
/* Get service port number. */
sp = getservbyname("bgp", "tcp");
peer->port = (sp == NULL) ? BGP_PORT_DEFAULT : ntohs(sp->s_port);

View File

@ -1595,8 +1595,6 @@ struct peer {
uint8_t update_delay_over; /* When this is set, BGP is no more waiting
for EOR */
/* Syncronization list and time. */
struct bgp_synchronize *sync[AFI_MAX][SAFI_MAX];
time_t synctime;
/* timestamp when the last UPDATE msg was written */
_Atomic time_t last_write;

View File

@ -1237,7 +1237,6 @@ 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 */
bgp_sync_delete(rfd->peer); /* don't need these */
/*
* since this peer is not on the I/O thread, this lock is not strictly

View File

@ -173,7 +173,6 @@ static void vnc_redistribute_add(struct prefix *p, uint32_t metric,
vncHD1VR.peer = peer_new(bgp);
vncHD1VR.peer->status =
Established; /* keep bgp core happy */
bgp_sync_delete(vncHD1VR.peer); /* don't need these */
/*
* since this peer is not on the I/O thread, this lock