From 8d976b0e2b78c3755d8d7868c535db8c8a163008 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 2 Aug 2021 08:59:24 +0300 Subject: [PATCH] bgpd: Set extended msg size only if we advertised and received capability If we don't advertise any capabilities (dont-capability-negotiate), we shouldn't set msg size to 65k only if received this capability from another peer. Before: ``` ~/frr# vtysh -c 'show ip bgp update-group' | grep 'Max packet size' Max packet size: 65535 ``` After: ``` ~/frr# vtysh -c 'show ip bgp update-group' | grep 'Max packet size' Max packet size: 4096 ``` Signed-off-by: Donatas Abraitis --- bgpd/bgp_open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 94d905127d..113017559e 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -1216,7 +1216,8 @@ int bgp_open_option_parse(struct peer *peer, uint8_t length, int *mp_capability) /* Extended Message Support */ peer->max_packet_size = - CHECK_FLAG(peer->cap, PEER_CAP_EXTENDED_MESSAGE_RCV) + (CHECK_FLAG(peer->cap, PEER_CAP_EXTENDED_MESSAGE_RCV) + && CHECK_FLAG(peer->cap, PEER_CAP_EXTENDED_MESSAGE_ADV)) ? BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE : BGP_STANDARD_MESSAGE_MAX_PACKET_SIZE; -- 2.39.5