]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_damp.c
bgpd: fix cleanup of dampening configuration
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 19 Oct 2018 18:53:46 +0000 (15:53 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Sat, 20 Oct 2018 15:39:05 +0000 (12:39 -0300)
commit2ba315c80192db294786d244d7a31a7f680f0fc4
tree260b3b37d4e7f57ec138abfcc41c5f31fb079bb2
parentaffa816bd6f0c3c575f99e5b7b8d0f03d83d5e40
bgpd: fix cleanup of dampening configuration

The bgp_damp_config_clean() function was deallocating some arrays without
resetting the variables that represent their sizes. This was leading to
some crashes because other parts of the code iterate over these arrays
by looking at their corresponding sizes, which could be invalid.

Fixes the following segfaults (which only happen under certain
circumstances):
vtysh -c "configure terminal" -c "router bgp 1" -c "bgp dampening"
vtysh -c "configure terminal" -c "router bgp 1" -c "no bgp dampening"
vtysh -c "configure terminal" -c "router bgp 1" -c "no bgp dampening 45"
vtysh -c "" -c "clear ip bgp dampening"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
bgpd/bgp_damp.c