This is so that the allocate_find will return the oldest IP.
And, the allocate_find will now use an index, rather than
potentially scanning the entire table
pool_key = 0, \
callingstationid = '', \
username = '', \
- expiry_time = NULL \
+ expiry_time = NOW() \
WHERE expiry_time <= NOW() - INTERVAL 1 SECOND \
AND nasipaddress = '%{Nas-IP-Address}'"
# SELECT framedipaddress \
# FROM ${ippool_table} \
# WHERE pool_name = '%{control:Pool-Name}' \
-# AND expiry_time IS NULL \
+# AND expiry_time < NOW() \
# ORDER BY RAND() \
# LIMIT 1 \
# FOR UPDATE"