]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: Add support for flowspec prefixes in bgp_packet_mpattr_prefix_size
authorStephane Poignant <stephane.poignant@proton.ch>
Thu, 15 Dec 2022 13:53:48 +0000 (14:53 +0100)
committerStephane Poignant <stephane.poignant@proton.ch>
Thu, 15 Dec 2022 13:53:48 +0000 (14:53 +0100)
commit0a9705a1e07c1d8176fd21f8f1bde2a9a155331b
tree9ac7b58d11e3d63d10d1a6acce53af372bb3e25b
parent9da878b66abb654c46b99e529bb01e7878999a9f
bgpd: Add support for flowspec prefixes in bgp_packet_mpattr_prefix_size

Currently, bgp_packet_mpattr_prefix_size (bgpd/bgp_attr.c:3978) always returns zero for Flowspec prefixes.
This is because, for flowspec prefixes, the prefixlen attribute of the prefix struct is always set to 0, and the actual length is bytes is set inside the flowspec_prefix struct instead (see lib/prefix.h:293 and lib/prefix.h:178).
Because of this, with a large number of flowspec NLRIs, bgpd ends up building update messages that exceed the maximum size and cause the peer to drop the connection (bgpd/bgp_updgrp_packet.c:L719).
The proposed change allows the bgp_packet_mpattr_prefix_size to return correct result for flowspec prefixes.

Signed-off-by: Stephane Poignant <stephane.poignant@proton.ch>
bgpd/bgp_attr.c