]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: Convert bgp_packet_mpattr_prefix_size to use an enum
authorDonald Sharp <sharpd@nvidia.com>
Fri, 16 Dec 2022 12:58:54 +0000 (07:58 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 16 Dec 2022 12:58:54 +0000 (07:58 -0500)
commit4487f0bd2cfa63823a3cde7509d704471bca817a
tree52719ce6d02642ed33dd2adc03c88fd945d5ccd7
parent960ad09f93053bfb5f0b6e5055ab044fa4433c72
bgpd: Convert bgp_packet_mpattr_prefix_size to use an enum

The function bgp_packet_mpattr_prefix_size had an if/else
body that allowed people to add encoding types to bgpd
such that we could build the wrong size packets.  This
was exposed recently in commit:
0a9705a1e07c1d8176fd21f8f1bde2a9a155331b

Where it was discovered flowspec was causing bgp update
messages to exceed the maximum size and the peer to
drop the connection.  Let's be proscriptive about this
and hopefully make it so that things don't work when
someone adds a new safi to the system ( and they'll have
to update this function ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_attr.c