]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: fix memory leak in vrf inst for evpn route 5312/head
authorChirag Shah <chirag@cumulusnetworks.com>
Thu, 7 Nov 2019 23:09:23 +0000 (15:09 -0800)
committerChirag Shah <chirag@cumulusnetworks.com>
Mon, 11 Nov 2019 16:27:55 +0000 (08:27 -0800)
commit3c11d70a107ea2192d8a990add463f3250429e66
tree732e6731ec1b2bfca33841086b126cd86c6f1b61
parenta97a1e11449bb21d74c69ac0d130439430484df0
bgpd: fix memory leak in vrf inst for evpn route

There is a memory leak of the bgp node (route node)
in bgp vrf rib table while processing evpn remote routes.

During the remote evpn route processing, a new route
is imported and created in per vrf bgp rib route table,
the refcount for the route node is incremented multiple
times.

Post evpn route creation, the bgp (route) node refcount needs
to be decremented.

Ticket:CM-26838,CM-27169
Reviewed By:CCR-9477
Testing Done:

Before fix:
----------
initial state:
TORC1#vtysh -c "show memory"
BGP node                      :      515    184
BGP route                     :      568    112

with 1 mac-ip route:
TORC1#vtysh -c "show memory"
BGP node                      :      524    184
BGP route                     :      583    112

withdraw 1 mac-ip route:
TORC1#vtysh -c "show memory"
BGP node                      :      520    184
BGP route                     :      568    112

After fix:
withdra 1 mac-ip route
TORC1#vtysh -c "show memory"
BGP node                      :      515    184
BGP route                     :      568    112

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
bgpd/bgp_evpn.c