From: Nick Porter Date: Fri, 23 Jun 2023 11:32:45 +0000 (+0100) Subject: Extend expiry time of dynamic IP owner, if shorter than specified lifetime X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=500b5c9b30427897ce9b9feb82cdf3637bcbc806;p=thirdparty%2Ffreeradius-server.git Extend expiry time of dynamic IP owner, if shorter than specified lifetime --- diff --git a/src/modules/rlm_redis_ippool/rlm_redis_ippool.c b/src/modules/rlm_redis_ippool/rlm_redis_ippool.c index 50522e163ce..9aa2b93ebb7 100644 --- a/src/modules/rlm_redis_ippool/rlm_redis_ippool.c +++ b/src/modules/rlm_redis_ippool/rlm_redis_ippool.c @@ -235,6 +235,9 @@ static char lua_alloc_cmd[] = " if expires_in < tonumber(ARGV[2]) then" EOL /* 16 */ " redis.call('ZADD', pool_key, 'XX', ARGV[1] + ARGV[2] + (static and " STRINGIFY(IPPOOL_STATIC_BIT) " or 0), exists)" EOL /* 17 */ " expires_in = tonumber(ARGV[2])" EOL /* 18 */ + " if not static then" EOL + " redis.call('EXPIRE', owner_key, ARGV[2])" EOL + " end" EOL " end" EOL /* 19 */ /*