diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 2cea9971e6..269f5c2948 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -1517,8 +1517,6 @@ enum bgp_fsm_state_progress bgp_stop(struct peer *peer) if (peer->ibuf_work) ringbuf_wipe(peer->ibuf_work); - if (peer->obuf_work) - stream_reset(peer->obuf_work); if (peer->curr) { stream_free(peer->curr); diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index eccc32f7ab..91a339f7ed 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1415,20 +1415,6 @@ struct peer *peer_new(struct bgp *bgp) peer->obuf = stream_fifo_new(); pthread_mutex_init(&peer->io_mtx, NULL); - /* We use a larger buffer for peer->obuf_work in the event that: - * - We RX a BGP_UPDATE where the attributes alone are just - * under BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE. - * - The user configures an outbound route-map that does many as-path - * prepends or adds many communities. At most they can have - * CMD_ARGC_MAX args in a route-map so there is a finite limit on how - * large they can make the attributes. - * - * Having a buffer with BGP_MAX_PACKET_SIZE_OVERFLOW allows us to avoid - * bounds checking for every single attribute as we construct an - * UPDATE. - */ - peer->obuf_work = - stream_new(BGP_MAX_PACKET_SIZE + BGP_MAX_PACKET_SIZE_OVERFLOW); peer->ibuf_work = ringbuf_new(BGP_MAX_PACKET_SIZE * BGP_READ_PACKET_MAX); @@ -2622,11 +2608,6 @@ int peer_delete(struct peer *peer) peer->ibuf_work = NULL; } - if (peer->obuf_work) { - stream_free(peer->obuf_work); - peer->obuf_work = NULL; - } - /* Local and remote addresses. */ if (peer->su_local) { sockunion_free(peer->su_local); diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 683d226d7b..7929204583 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1167,7 +1167,6 @@ struct peer { uint8_t ibuf_scratch[BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE * BGP_READ_PACKET_MAX]; struct ringbuf *ibuf_work; // WiP buffer used by bgp_read() only - struct stream *obuf_work; // WiP buffer used to construct packets struct stream *curr; // the current packet being parsed diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index 67c70431bd..e5e3261f08 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -1252,12 +1252,9 @@ static int rfapi_open_inner(struct rfapi_descriptor *rfd, struct bgp *bgp, if (rfd->peer->ibuf_work) ringbuf_del(rfd->peer->ibuf_work); - if (rfd->peer->obuf_work) - stream_free(rfd->peer->obuf_work); rfd->peer->ibuf = NULL; rfd->peer->obuf = NULL; - rfd->peer->obuf_work = NULL; rfd->peer->ibuf_work = NULL; } diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index 9c971272e4..8ca53e56b2 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -189,12 +189,9 @@ static void vnc_redistribute_add(struct prefix *p, uint32_t metric, if (vncHD1VR.peer->ibuf_work) ringbuf_del(vncHD1VR.peer->ibuf_work); - if (vncHD1VR.peer->obuf_work) - stream_free(vncHD1VR.peer->obuf_work); vncHD1VR.peer->ibuf = NULL; vncHD1VR.peer->obuf = NULL; - vncHD1VR.peer->obuf_work = NULL; vncHD1VR.peer->ibuf_work = NULL; }