mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 00:59:13 +00:00
bgpd: Bypass SA tests regarding division by zero for reuse_limit in dampening
reuse_limit can't be zero basically, Coverity just does not know how the value comes in. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
7d1d2517ea
commit
3ec5c50019
@ -50,6 +50,12 @@ static int bgp_reuse_index(int penalty, struct bgp_damp_config *bdc)
|
||||
unsigned int i;
|
||||
int index;
|
||||
|
||||
/*
|
||||
* reuse_limit can't be zero, this is for Coverity
|
||||
* to bypass division by zero test.
|
||||
*/
|
||||
assert(bdc->reuse_limit);
|
||||
|
||||
i = (int)(((double)penalty / bdc->reuse_limit - 1.0)
|
||||
* bdc->scale_factor);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user