From 8dcad8e9fdfea1695e078564fea17bad4ca59adc Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Fri, 10 Jun 2022 12:35:00 +0300 Subject: [PATCH 1/2] bgpd: last_reset_cause_size can't be larger than 65k bytes Reduce the scope, to avoid comparing uint16_t vs. size_t in a loop. ``` vty_out(vty, " Message received that caused BGP to send a NOTIFICATION:\n "); for (i = 1; i <= p->last_reset_cause_size; i++) { ``` Signed-off-by: Donatas Abraitis --- bgpd/bgpd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index bf26bdc5b0..98e59bcc85 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1637,7 +1637,7 @@ struct peer { * a new value to the last_reset reason */ - size_t last_reset_cause_size; + uint16_t last_reset_cause_size; uint8_t last_reset_cause[BGP_MAX_PACKET_SIZE]; /* The kind of route-map Flags.*/ From 0019e31c3b8a11494b739b6240b17979dfdad23a Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Fri, 10 Jun 2022 12:53:10 +0300 Subject: [PATCH 2/2] bgpd: Drop sockunion_vty_out() wrong definition Probably leftover. Signed-off-by: Donatas Abraitis --- bgpd/bgp_route.c | 1 - 1 file changed, 1 deletion(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 5df45aa315..ac6e7f192f 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -9846,7 +9846,6 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn, char buf[INET6_ADDRSTRLEN]; char buf1[BUFSIZ]; struct attr *attr = path->attr; - int sockunion_vty_out(struct vty *, union sockunion *); time_t tbuf; json_object *json_bestpath = NULL; json_object *json_cluster_list = NULL;