diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-01-24 17:47:17 -0500 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-01-24 17:47:17 -0500 |
| commit | 096476ddb09fd7bf8946c5429bd9903dd33f3d78 (patch) | |
| tree | 9f5cde801d8ebd334a49ac481cfcc6005037fbaf | |
| parent | cadc5f3377eec33c17e5cc230b0671c884c3fcca (diff) | |
bgpd: check flags before attempting keepalive ops
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>
| -rw-r--r-- | bgpd/bgp_keepalives.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bgpd/bgp_keepalives.c b/bgpd/bgp_keepalives.c index a6976109a8..5a48c7013e 100644 --- a/bgpd/bgp_keepalives.c +++ b/bgpd/bgp_keepalives.c @@ -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); |
