]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't restart polling if we're already polling
authorAlan T. DeKok <aland@freeradius.org>
Mon, 13 Mar 2023 20:29:05 +0000 (16:29 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 14 Mar 2023 21:10:39 +0000 (17:10 -0400)
src/listen/bfd/session.c

index d1ea0423c9fb4378ed929b67e799da859c5f1eda..8ff001e0949b3b3e39d6490392ecdd66646b6e66 100644 (file)
@@ -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);
 }