[cmaster-next] [PATCH] bgpd: Remove nexthop for peer only for "real" peer

Donald Sharp sharpd at cumulusnetworks.com
Sat Dec 3 21:51:49 EST 2016


From: vivek <vivek at cumulusnetworks.com>

During connection establishment, there is a separate peer structure created
for the doppelganger (for incoming connection). When this is deleted after
the connection has established, take care to ensure that the nexthop entry
for the peer is not deleted.

Fixes: f9164b1d74f6a20d69d7ef10d2e39b4ae7996cbf
Signed-off-by: Vivek Venkatraman <vivek at cumulusnetworks.com>

Ticket: CM-13875
Reviewed By: None
Testing Done: Manual

(cherry picked from commit 4f2bc892cbddbf36bd5e1b2f36c33260af614b33)
---
 bgpd/bgpd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 7675df2..7f92310 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -1972,7 +1972,8 @@ peer_delete (struct peer *peer)
   bgp_fsm_change_status (peer, Deleted);
   
   /* Remove from NHT */
-  bgp_unlink_nexthop_by_peer (peer);
+  if (CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE))
+    bgp_unlink_nexthop_by_peer (peer);
   
   /* Password configuration */
   if (peer->password)
-- 
2.5.5





More information about the dev mailing list