From c81d6d4d5fbd551888d9297038fa19eb27ef9d50 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 21 Jul 2023 12:41:35 -0400 Subject: [PATCH] bgpd: Remove peer->sync array It is never used. Signed-off-by: Donald Sharp --- bgpd/bgp_advertise.c | 26 -------------------------- bgpd/bgp_advertise.h | 2 -- bgpd/bgpd.c | 4 ---- bgpd/bgpd.h | 2 -- bgpd/rfapi/rfapi.c | 1 - bgpd/rfapi/vnc_zebra.c | 1 - 6 files changed, 36 deletions(-) diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c index 9686b08a98..da7b496d65 100644 --- a/bgpd/bgp_advertise.c +++ b/bgpd/bgp_advertise.c @@ -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]); - } -} diff --git a/bgpd/bgp_advertise.h b/bgpd/bgp_advertise.h index c5e2a5f216..c461f231b4 100644 --- a/bgpd/bgp_advertise.h +++ b/bgpd/bgp_advertise.h @@ -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, diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 91a339f7ed..fa28a3098b 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1171,8 +1171,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); diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 7929204583..a9d77f862f 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1605,8 +1605,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; diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index e5e3261f08..985094d323 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -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 diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index 8ca53e56b2..c17b17a335 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -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