From 73b66bed83a38eea37371c6bbb0655c72c903293 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 23 Jul 2023 20:30:47 -0400 Subject: bgpd: The last_reset_cause in the peer structure is too large The last_reset_cause is a plain old BGP_MAX_PACKET_SIZE buffer that is really enlarging the peer data structure. Let's just copy the stream that failed and only allocate how ever much the packet size actually was. While it's likely that we have a reset reason, the packet typically is not going to be 65k in size. Let's save space. Signed-off-by: Donald Sharp --- bgpd/bgpd.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bgpd/bgpd.h') diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 5c42abef5e..5e467bb873 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1716,8 +1716,7 @@ struct peer { * a new value to the last_reset reason */ - uint16_t last_reset_cause_size; - uint8_t last_reset_cause[BGP_MAX_PACKET_SIZE]; + struct stream *last_reset_cause; /* The kind of route-map Flags.*/ uint16_t rmap_type; -- cgit v1.2.3