From: Masamichi Hosoda Date: Wed, 28 Jul 2021 19:14:18 +0000 (+0900) Subject: Fix connection_check (#4154) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d979237adf03e47e8aec55c49b33fb330ec13061;p=thirdparty%2Ffreeradius-server.git Fix connection_check (#4154) 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. --- diff --git a/src/lib/server/pool.c b/src/lib/server/pool.c index 1ac92c88810..2799f803370 100644 --- a/src/lib/server/pool.c +++ b/src/lib/server/pool.c @@ -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; }