>From bd07ec41b9e3ab68a2f4696e751cfadd794a0909 Mon Sep 17 00:00:00 2001
From: Chris Moules <chris@gms.lu>
Date: Wed, 18 Feb 2009 12:48:52 +0000
Subject: [PATCH] Patch so that the "allocate-find" ippool lookup will match "expiry_time" when is NULL. This is its default state, so unless otherwise set, you will never get a IP from the pool.

---
 raddb/sql/mysql/ippool.conf |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/raddb/sql/mysql/ippool.conf b/raddb/sql/mysql/ippool.conf
index f93d7d1..7bddd16 100644
--- a/raddb/sql/mysql/ippool.conf
+++ b/raddb/sql/mysql/ippool.conf
@@ -28,7 +28,7 @@
 ## The ORDER BY clause of this query tries to allocate the same IP-address
 ## which user had last session...
 allocate-find = "SELECT framedipaddress FROM ${ippool_table} \
- WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < NOW() \
+ WHERE pool_name = '%{control:Pool-Name}' AND (expiry_time < NOW() OR expiry_time IS NULL) \
  ORDER BY (username <> '%{User-Name}'), \
  (callingstationid <> '%{Calling-Station-Id}'), \
  expiry_time \
-- 
1.5.6.5

