]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Free non-best paths also during table cleanup
authorvivek <vivek@cumulusnetworks.com>
Fri, 15 May 2020 21:32:38 +0000 (14:32 -0700)
committervivek <vivek@cumulusnetworks.com>
Fri, 15 May 2020 21:32:38 +0000 (14:32 -0700)
Non-best paths (path info structures) also need to be freed during
table cleanup not only to release their memory but to also ensure
any linkages are updated correctly. One such example is for EVPN
where there is a link between the imported path info (in a L2 or
L3 vrf instance) and its parent path info.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
bgpd/bgp_route.c

index e8151d94eddee5a471d4c3782a04a3620b90198a..cd377b32caf7b473b8fcc627e1b96b35d71b996e 100644 (file)
@@ -4706,8 +4706,9 @@ static void bgp_cleanup_table(struct bgp *bgp, struct bgp_table *table,
 
                                if (bgp_fibupd_safi(safi))
                                        bgp_zebra_withdraw(p, pi, bgp, safi);
-                               bgp_path_info_reap(rn, pi);
                        }
+
+                       bgp_path_info_reap(rn, pi);
                }
 }