]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Notice when peer_clear fails
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 30 May 2018 13:37:03 +0000 (09:37 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 30 May 2018 13:37:03 +0000 (09:37 -0400)
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 <sharpd@cumulusnetworks.com>
bgpd/bgp_route.c

index 132fa5fc9d391e36ab53883987aa199eefe59e6e..390bdaeca3027d56c9689bcd5fa1c76bdc7c350d 100644 (file)
@@ -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;
 }