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. 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. 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. 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.
-- hugh
-- hugh
Hugh Messenger wrote:
I said:
2) Where can I find the sqlippool schema in 2.0.0?
It's in the Postgresql schema file, but not in MySQL. ...
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'.
No. "check:foo" is a hold-over from 1.x. It should be "control:..." ...
... I have to change the %{FramedIPAddress} to %I to get this query to work.
Or, Framed-IP-Address. But I don't see that typo in the CVS head.
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.
The lines are wrapped at 80 characters, with '\' at the end. It should work, and it makes it easier to read. Alan DeKok.
On Wed 27 Jun 2007, Alan DeKok wrote:
Hugh Messenger wrote:
I said:
2) Where can I find the sqlippool schema in 2.0.0?
It's in the Postgresql schema file, but not in MySQL.
...
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'.
No. "check:foo" is a hold-over from 1.x. It should be "control:..."
fixed. -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc
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
Peter Nixon [mailto:listuser@peternixon.net] said
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.
Okie Dokie.
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 ;-)
I just noticed the 'man unlang' paragraph about 'check' being a synonym for 'control'. Did that just get added, or was I being blind first time round? I do try and read the docs before posting here, and I'd hate to think I missed that.
2) In the allocate-update query ... [snip] ... I have to change the %{FramedIPAddress} to %I to get this query to work.
I dont see this problem...
I'll look at that again. Alan pointed out the typo, but that was in this (email) copy of the text, where I'd copied and (incorrectly) edited my working version of the file. However, it's possible I may have done the same while testing, so I'll get back to you on that one.
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?
First problem is the new version is Windows Unfriendly, as it uses all lower case column names in the queries, although the schema in mysql.sql still uses mixed case names. Which of course you are committed to using anyway, because of awkward people like me who already have Windows MySQL radippool's, and are unwilling to enable the 'ignore case' option. :) I'll friendly-up the new mysql-ippool-dialup.conf and send you a copy.
Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc
-- hugh
On Wed 27 Jun 2007, Hugh Messenger wrote:
Peter Nixon [mailto:listuser@peternixon.net] said
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.
Okie Dokie.
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 ;-)
I just noticed the 'man unlang' paragraph about 'check' being a synonym for 'control'. Did that just get added, or was I being blind first time round? I do try and read the docs before posting here, and I'd hate to think I missed that.
2) In the allocate-update query ...
[snip]
... I have to change the %{FramedIPAddress} to %I to get this query to work.
I dont see this problem...
I'll look at that again. Alan pointed out the typo, but that was in this (email) copy of the text, where I'd copied and (incorrectly) edited my working version of the file. However, it's possible I may have done the same while testing, so I'll get back to you on that one.
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?
First problem is the new version is Windows Unfriendly, as it uses all lower case column names in the queries, although the schema in mysql.sql still uses mixed case names. Which of course you are committed to using anyway, because of awkward people like me who already have Windows MySQL radippool's, and are unwilling to enable the 'ignore case' option. :)
I'll friendly-up the new mysql-ippool-dialup.conf and send you a copy.
Sounds like a plan :-) -- Peter Nixon http://www.peternixon.net/ PGP Key: http://www.peternixon.net/public.asc
I'll friendly-up the new mysql-ippool-dialup.conf and send you a copy.
Sounds like a plan :-)
Remember to change any value substitutions to the new scheme %{%{foo}:-%{bar}} :) -- Arran Cudbard-Bell (A.Cudbard-Bell@sussex.ac.uk) Authentication, Authorisation and Accounting Officer Infrastructure Services | ENG1 E1-1-08 University Of Sussex, Brighton EXT:01273 873900 | INT: 3900
Hugh Messenger wrote:
I just noticed the 'man unlang' paragraph about 'check' being a synonym for 'control'. Did that just get added, or was I being blind first time round? I do try and read the docs before posting here, and I'd hate to think I missed that.
I added it. Alan DeKok.
participants (4)
-
Alan DeKok -
Arran Cudbard-Bell -
Hugh Messenger -
Peter Nixon