From: Alan T. DeKok Date: Mon, 13 Mar 2023 20:29:05 +0000 (-0400) Subject: don't restart polling if we're already polling X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83008aa2bb6b4e09466930bb5f00f3fb524e0a37;p=thirdparty%2Ffreeradius-server.git don't restart polling if we're already polling --- diff --git a/src/listen/bfd/session.c b/src/listen/bfd/session.c index d1ea0423c9f..8ff001e0949 100644 --- a/src/listen/bfd/session.c +++ b/src/listen/bfd/session.c @@ -78,6 +78,8 @@ static int bfd_stop_poll(bfd_session_t *session) { if (!session->doing_poll) return 0; + session->doing_poll = false; + /* * We tried to increase the min_tx during a polling * sequence. That isn't kosher, so we instead waited @@ -95,15 +97,12 @@ static int bfd_stop_poll(bfd_session_t *session) if (!session->remote_demand_mode) { fr_assert(session->ev_timeout != NULL); fr_assert(session->ev_packet != NULL); - session->doing_poll = false; bfd_stop_control(session); bfd_start_control(session); return 1; } - session->doing_poll = false; - return bfd_stop_control(session); } @@ -867,9 +866,13 @@ static void bfd_set_desired_min_tx_interval(bfd_session_t *session, fr_time_delt */ session->desired_min_tx_interval = value; - bfd_stop_control(session); - session->doing_poll = 0; + /* + * Already polling, don't change anything. + */ + if (session->doing_poll) return; + + bfd_stop_control(session); bfd_start_poll(session); }