mirror_frr/tests/bgpd
Quentin Young 556beacf10 bgpd: rework BGP_MAX_PACKET_SIZE & friends
BGP_MAX_PACKET_SIZE no longer represented the absolute maximum BGP
packet size as it did before, instead it was defined as 4096 bytes,
which is the maximum unless extended message capability is negotiated,
in which case the maximum goes to 65k.

That introduced at least one bug - last_reset_cause was undersized for
extended messages, and when sending an extended message > 4096 bytes
back to a peer as part of NOTIFY data would trigger a bounds check
assert.

This patch redefines the macro to restore its previous meaning,
introduces a new macro - BGP_STANDARD_MESSAGE_MAX_PACKET_SIZE - to
represent the 4096 byte size, and renames the extended size to
BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE for consistency. Code locations
that definitely should use the small size have been updated, locations
that semantically always need whatever the max is, no matter what that
is, use BGP_MAX_PACKET_SIZE.

BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE should only be used as a constant
when storing what the negotiated max size is for use at runtime and to
define BGP_MAX_PACKET_SIZE. Unless there is a future standard that
introduces a third valid size it should not be used for any other
purpose.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-05-06 11:54:02 -04:00
..
test_aspath.c bgpd: rework BGP_MAX_PACKET_SIZE & friends 2021-05-06 11:54:02 -04:00
test_aspath.py *: reformat python files 2020-10-07 17:22:26 -04:00
test_bgp_table.c :* Convert prefix2str to %pFX 2020-10-22 09:07:41 +03:00
test_bgp_table.py *: reformat python files 2020-10-07 17:22:26 -04:00
test_capability.c bgpd: rework BGP_MAX_PACKET_SIZE & friends 2021-05-06 11:54:02 -04:00
test_capability.py *: reformat python files 2020-10-07 17:22:26 -04:00
test_ecommunity.c *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
test_ecommunity.py *: reformat python files 2020-10-07 17:22:26 -04:00
test_mp_attr.c bgpd: rework BGP_MAX_PACKET_SIZE & friends 2021-05-06 11:54:02 -04:00
test_mp_attr.py *: reformat python files 2020-10-07 17:22:26 -04:00
test_mpath.c tests: tests for bgpd listing on multiple addresses 2021-01-11 08:33:52 +00:00
test_mpath.py *: reformat python files 2020-10-07 17:22:26 -04:00
test_packet.c tests: tests for bgpd listing on multiple addresses 2021-01-11 08:33:52 +00:00
test_peer_attr.c tests: tests for bgpd listing on multiple addresses 2021-01-11 08:33:52 +00:00
test_peer_attr.py *: reformat python files 2020-10-07 17:22:26 -04:00