summaryrefslogtreecommitdiff
path: root/bgpd/bgp_nht.h
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@hpe.com>2016-09-06 17:23:48 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-18 08:39:23 -0400
commitf9164b1d74f6a20d69d7ef10d2e39b4ae7996cbf (patch)
treec454b8497e53a117b634f1bda0ab5faa2c74308c /bgpd/bgp_nht.h
parent5f753f56cf350af52257780a502b35edf22d4bf8 (diff)
bgpd: bgp_nexthop_cache not deleted with peers
* Fix mild leak, bgp_nexthop_caches were not deleted when their peer was. Not a huge one, but makes valgrinding for other leaks noisier. Credit to Lou Berger <lberger@labn.net> for doing the hard work of debugging and pinning down the leak, and supplying an initial fix. That one didn't quite get the refcounting right, it seemed, hence this version. This version also keeps bncs pinned so long as the peer is defined, where Lou's tried to delete whenever the peer went through bgp_stop. That causes lots of zebra traffic if down peers go Active->Connect->Active, etc., so leaving bnc's in place until peer_delete seemed better. * bgp_nht.c: (bgp_unlink_nexthop_by_peer) similar to bgp_unlink_nexthop, but by peer. * bgp_nht.c: (bgp_unlink_nexthop_check) helper to consolidate checking if a bnc should be deleted. (bgp_unlink_nexthop_by_peer) ensure the bnc->nht_info peer reference is removed, and hence allow bncs to be removed by previous. * bgpd.c: (peer_delete) cleanup the peer's bnc.
Diffstat (limited to 'bgpd/bgp_nht.h')
-rw-r--r--bgpd/bgp_nht.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/bgpd/bgp_nht.h b/bgpd/bgp_nht.h
index af64750d75..02a7e5a45c 100644
--- a/bgpd/bgp_nht.h
+++ b/bgpd/bgp_nht.h
@@ -55,6 +55,7 @@ extern int bgp_find_or_add_nexthop(struct bgp *bgp, afi_t a,
* p - path structure.
*/
extern void bgp_unlink_nexthop(struct bgp_info *p);
+void bgp_unlink_nexthop_by_peer (struct peer *);
/**
* bgp_delete_connected_nexthop() - Reset the 'peer' pointer for a connected