From a9bafa95d05789154aa9482d20aa73fb42ff3489 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 30 May 2018 09:37:03 -0400 Subject: [PATCH] bgpd: Notice when peer_clear fails Issue Found by Coverity Scan. When we call peer_clear we are checking the return code in every other call. Add a bit of extra code to notice the failure and note it. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 132fa5fc9d..390bdaeca3 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2551,7 +2551,9 @@ static int bgp_maximum_prefix_restart_timer(struct thread *thread) "%s Maximum-prefix restart timer expired, restore peering", peer->host); - peer_clear(peer, NULL); + if ((peer_clear(peer, NULL) < 0) && bgp_debug_neighbor_events(peer)) + zlog_debug("%s: %s peer_clear failed", + __PRETTY_FUNCTION__, peer->host); return 0; } -- 2.39.5