Skip to content

Commit

Permalink
bgpd: check flags before attempting keepalive ops
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
qlyoung committed Jan 24, 2018
1 parent cadc5f3 commit 096476d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bgpd/bgp_keepalives.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 096476d

Please sign in to comment.