]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Extend expiry time of dynamic IP owner, if shorter than specified lifetime
authorNick Porter <nick@portercomputing.co.uk>
Fri, 23 Jun 2023 11:32:45 +0000 (12:32 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 23 Jun 2023 11:32:45 +0000 (12:32 +0100)
src/modules/rlm_redis_ippool/rlm_redis_ippool.c

index 50522e163ce8d7cc2f44fba691e72e2ef9c349db..9aa2b93ebb7d575ed24b4b25a9d16300d8676a25 100644 (file)
@@ -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 */
 
        /*