On Wed 27 Jun 2007, Hugh Messenger wrote:
I said:
2) Where can I find the sqlippool schema in 2.0.0?
I went ahead and used the same schema from 1.1.6, seems to be OK. But I'd still like to know where to find it documented, for next time I need it.
From now on (20 min ago), MySQL should be a fully support dialect for rlm_sqlippool so the table is part of the normal schema and the queries _should_ work by default. Please send patches for anything that is still broken as I don't test against MySQL myself.
Anyway, there seems to be a few issues in the mysql-ippool-dialup.conf file.
1) In the allocate-find query ...
allocate-find = "SELECT FramedIPAddress FROM radippool \ WHERE pool_name = '%{reply:Pool-Name}' AND expiry_time < NOW() \ ORDER BY pool_name, (UserName <> '%{User-Name}'), (CallingStationId <> '%{Calling-Station-Id}'), expiry_time \ LIMIT 1 \ FOR UPDATE"
It seems to want %{check:Pool-Name}. Which is weird in itself, because 'man unlang' doesn't mention a 'check' list type, it should be 'request'. But that doesn't work! The only thing that seems to work in 2.0.0 is %{check:Pool-Name}. Can't just be %{Pool-Name}, either.
fixed. Alan changed things after I wrote it ;-)
2) In the allocate-update query ...
allocate-update = "UPDATE radippool \ SET NASIPAddress = '%{NAS-IP-Address}', pool_key = '${pool-key}', \ CallingStationId = '%{Calling-Station-Id}', UserName = '%{User-Name}', \ expiry_time = NOW() + INTERVAL ${lease-duration} SECOND \ WHERE FramedIPAddress = '%{FramedIPAddress}'"
... I have to change the %{FramedIPAddress} to %I to get this query to work.
I dont see this problem...
3) Looks like the file is line wrapped at 80 chars, all long lines had to be joined back together. I don't know if this was an artifact of the way I checked out / updated in cvs, or if the file is actually like that.
OK. I have significantly updated the mysql queries according to the second set of queries at: http://wiki.freeradius.org/Talk:Rlm_sqlippool Can you please update to current cvs and tell me if anything else needs fixing? -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc