]> git.proxmox.com Git - mirror_frr.git/commit - bgpd/bgp_route.c
bgpd: Fix memleak, adapt adv- to recv-routes code
authorPascal Mathis <mail@pascalmathis.com>
Wed, 16 May 2018 19:55:55 +0000 (21:55 +0200)
committerPascal Mathis <mail@pascalmathis.com>
Wed, 16 May 2018 20:20:44 +0000 (22:20 +0200)
commitb755861b95142446bac05f0f2506647bbca5d2d8
tree55b2955640ef694b17e59f355a0cfc5e0a84a88f
parent6392aaa6547e665859ab5c648df30c1c04e26f6d
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>
bgpd/bgp_route.c