]> git.proxmox.com Git - mirror_frr.git/commit
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>
Mon, 17 Dec 2018 14:14:04 +0000 (12:14 -0200)
commit213bdb39a7326ab9622d48d770549b5d7d1d5878
treef435448099c1239c38c679364195c721c95a1244
parentf074a986aedadbd939724a84c4501df89b678d01
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