]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix connection_check (#4154)
authorMasamichi Hosoda <trueroad@users.noreply.github.com>
Wed, 28 Jul 2021 19:14:18 +0000 (04:14 +0900)
committerGitHub <noreply@github.com>
Wed, 28 Jul 2021 19:14:18 +0000 (13:14 -0600)
connection_check() in pool.c did not work
if more than 1 second has passed since the start of radiusd.
This commit makes the function works
as long as more than 1 second has passed since the last time it did work
by fixing a comparison operator.

src/lib/server/pool.c

index 1ac92c888106ee06f35331477e575ae9f137c817..2799f8033701437b122226aa3c4062b2030a44d1 100644 (file)
@@ -647,7 +647,7 @@ static int connection_check(fr_pool_t *pool, request_t *request)
        fr_time_t               now = fr_time();
        fr_pool_connection_t    *this, *next;
 
-       if ((now - pool->state.last_checked) >= NSEC) {
+       if ((now - pool->state.last_checked) < NSEC) {
                pthread_mutex_unlock(&pool->mutex);
                return 1;
        }