]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: check flags before attempting keepalive ops 1672/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 24 Jan 2018 22:47:17 +0000 (17:47 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 24 Jan 2018 22:47:17 +0000 (17:47 -0500)
If a peer already has keepalives turned on when asking to turn them on,
return immediately. Same thing for turning them off.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_keepalives.c

index a6976109a8f8c9c73cd0a3e248f3c72438b48e80..5a48c7013e63d55425cc7d9d94e76abc3afc263f 100644 (file)
@@ -224,6 +224,9 @@ void *bgp_keepalives_start(void *arg)
 
 void bgp_keepalives_on(struct peer *peer)
 {
+       if (CHECK_FLAG(peer->thread_flags, PEER_THREAD_KEEPALIVES_ON))
+               return;
+
        struct frr_pthread *fpt = frr_pthread_get(PTHREAD_KEEPALIVES);
        assert(fpt->running);
 
@@ -251,6 +254,9 @@ void bgp_keepalives_on(struct peer *peer)
 
 void bgp_keepalives_off(struct peer *peer)
 {
+       if (!CHECK_FLAG(peer->thread_flags, PEER_THREAD_KEEPALIVES_ON))
+               return;
+
        struct frr_pthread *fpt = frr_pthread_get(PTHREAD_KEEPALIVES);
        assert(fpt->running);