In case IPs exist in more than one pool.
# SET \
# gateway = '${gateway}', owner = '${owner}', \
# expiry_time = DATEADD(SECOND,${offer_duration},CURRENT_TIMESTAMP) \
-# WHERE address = '%{reply.${allocated_address_attr}}'"
+# WHERE address = '%{reply.${allocated_address_attr}}' \
+# AND pool_name = '%{control.${pool_name}}'"
#
# Use a stored procedure to find AND allocate the address. Read and customise
SET \
gateway = '${gateway}', owner = '${owner}', \
expiry_time = NOW() + INTERVAL ${offer_duration} SECOND \
- WHERE address = '%{reply.${allocated_address_attr}}'"
+ WHERE address = '%{reply.${allocated_address_attr}}' \
+ AND pool_name = '%{control.${pool_name}}'"
#
# Use a stored procedure to find AND allocate the address. Read and customise
# gateway = '${gateway}', \
# owner = '${owner}', \
# expiry_time = current_timestamp + INTERVAL '${offer_duration}' second(1) \
-# WHERE address = '%{reply.${allocated_address_attr}}'"
+# WHERE address = '%{reply.${allocated_address_attr}}' \
+# AND pool_name = '%{control.${pool_name}}'"
#
# gateway = '${gateway}', \
# owner = '${owner}', \
# expiry_time = 'now'::timestamp(0) + '${offer_duration} second'::interval \
-# WHERE address = '%{reply.${allocated_address_attr}}'"
+# WHERE address = '%{reply.${allocated_address_attr}}' \
+# AND pool_name = '%{control.${pool_name}}'"
#
# If the SELECT and UPDATE are in separate queries then set the following
gateway = '${gateway}', \
owner = '${owner}', \
expiry_time = datetime(strftime('%%s', 'now') + ${offer_duration}, 'unixepoch') \
- WHERE address = '%{reply.${allocated_address_attr}}'"
+ WHERE address = '%{reply.${allocated_address_attr}}' \
+ AND pool_name = '%{control.${pool_name}}'"
#