These are the same fields used for the other queries, so it makes
sense to use them here
Based on a patch from Chris Moules.
## START record arrives
start-update = "UPDATE ${ippool_table} \
SET expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \
- WHERE nasipaddress = '%{NAS-IP-Address}' AND pool_key = '${pool-key}'"
+ WHERE nasipaddress = '%{NAS-IP-Address}' AND pool_key = '${pool-key}' \
+ AND username = '%{User-Name}' \
+ AND callingstationid = '%{Calling-Station-Id}' \
+ AND framedipaddress = '%{Framed-IP-Address}'"
## This series of queries frees an IP number when an accounting
## STOP record arrives