mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-04 17:20:10 +00:00
bgpd: Correctly calculate threshold being reached
if (pcout > (pcount * peer->max_threshold[afi][safi] / 100 )) is always true. So the very first route received will always trigger the warning. We actually want the warning to happen when we hit the threshold. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
8b6b6b694d
commit
b1823b69f6
@ -3167,7 +3167,8 @@ bool bgp_maximum_prefix_overflow(struct peer *peer, afi_t afi, safi_t safi,
|
||||
UNSET_FLAG(peer->af_sflags[afi][safi],
|
||||
PEER_STATUS_PREFIX_LIMIT);
|
||||
|
||||
if (pcount > (pcount * peer->pmax_threshold[afi][safi] / 100)) {
|
||||
if (pcount
|
||||
> (peer->pmax[afi][safi] * peer->pmax_threshold[afi][safi] / 100)) {
|
||||
if (CHECK_FLAG(peer->af_sflags[afi][safi],
|
||||
PEER_STATUS_PREFIX_THRESHOLD)
|
||||
&& !always)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user