]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: bgp_nexthop_cache not deleted with peers
authorPaul Jakma <paul.jakma@hpe.com>
Tue, 6 Sep 2016 16:23:48 +0000 (17:23 +0100)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 18 Oct 2016 12:39:23 +0000 (08:39 -0400)
commitf9164b1d74f6a20d69d7ef10d2e39b4ae7996cbf
treec454b8497e53a117b634f1bda0ab5faa2c74308c
parent5f753f56cf350af52257780a502b35edf22d4bf8
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.
bgpd/bgp_nht.c
bgpd/bgp_nht.h
bgpd/bgpd.c