]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Fix memleak, adapt adv- to recv-routes code 2321/head
authorPascal Mathis <mail@pascalmathis.com>
Wed, 16 May 2018 19:55:55 +0000 (21:55 +0200)
committerPascal Mathis <mail@pascalmathis.com>
Tue, 29 May 2018 18:09:28 +0000 (20:09 +0200)
commitacd8748094be69831012284d297879c398ae8859
tree67f811c1cacfd35a5031e1675a498f6ab5248a9c
parent49a3410b7769e489ddb3a86c910227317393753d
bgpd: Fix memleak, adapt adv- to recv-routes code

This commit tries to adapt a similar codeflow within the `show bgp [afi]
[safi] neighbor <neighbor> advertised-routes` command compared to its
`received-routes` and `filtered-routes` opponents. Some branching code
has been restructured to achieve this.

Additionally, this commit fixes a memory leak within `received-routes`
(and `filtered-routes`, although the issue has been present before the
previous commit!) where the previous implementation forgot to
deduplicate the BGP attributes.

When a user called `<...> received-routes route-map <RM-TEST>` and that
routemap changed any AS path or community parameters, the duplicated
memory for these parameters was never freed. This has been fixed by
ensuring to call `bgp_attr_undup()` accordingly.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
(cherry picked from commit b755861b95142446bac05f0f2506647bbca5d2d8)
bgpd/bgp_route.c