]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Remove nexthop for peer only for "real" peer
authorvivek <vivek@cumulusnetworks.com>
Sun, 4 Dec 2016 02:51:49 +0000 (21:51 -0500)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 5 Dec 2016 14:48:46 +0000 (15:48 +0100)
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@cumulusnetworks.com>
Ticket: CM-13875
Reviewed By: None
Testing Done: Manual

(cherry picked from commit 4f2bc892cbddbf36bd5e1b2f36c33260af614b33)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgpd.c

index 7675df226b5fdfbd29e672ff2983daef79117a23..7f92310d919d849b220dc6196f15fb29666e5a80 100644 (file)
@@ -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)