(RADIATOR) Error in AddressAllocator SQL
William Hernandez
whr at essnet.com
Fri Jan 23 12:36:01 CST 2004
Hello Hugh,
Yes, the DSQUERY environment variable is now in the startup
script, but that only solves the initial connection problem.
For the second problem which was the "Too many simultaneous
address requests" message in radius.log I'm testing the following
modified AddressAllocatorSQL.pm. It appears that when the
connection is to MS SQLServer the original "next unless
$self->do($update, undef,..." always goes to "next".
# diff -ub AddressAllocatorSQL.pm-3.7.1 AddressAllocatorSQL.pm
--- AddressAllocatorSQL.pm-3.7.1 2003-04-14
07:22:13.000000000 -0400
+++ AddressAllocatorSQL.pm 2004-01-23 14:03:09.000000000
-0400
@@ -151,12 +151,32 @@
# If this fails, then its prob because someone else
# got the same address before us. Try again
- next unless $self->do($update, undef,
+ my $result = $self->do($update, undef,
map { &Radius::Util::format_special
($_, $p, undef, $now, $expiry,
$username, $details{yiaddr},
$last_time_stamp)}
@{$self->{AllocateQueryBindVar}}) == 1;
+ &main::log($main::LOG_DEBUG, "\"$update\":
\$result=$result");
+ # Don't seem to be getting back a result code.
+ # We'll try to read back the record.
+ my $testquery="select count(*) from RADPOOL
+ where STATE=1
+ and TIME_STAMP=$now
+ and EXPIRY=$expiry
+ and USERNAME=\'$username\'
+ and YIADDR=\'$details{yiaddr}\'";
+ my $teststh = $self->do($testquery);
+ if ( !$teststh )
+ {
+ &main::log($main::LOG_DEBUG, "\"$testquery\"
unsuccessful");
+ next;
+ }
+ else
+ {
+ my ($count) = $self->getOneRow($teststh);
+ &main::log($main::LOG_DEBUG, "\"$testquery\"
successful: returned $count row");
+ }
# Call the callers allocateDone() function to process
# the results
$caller->allocateDone($p, \%details);
This results in:
Fri Jan 23 14:07:36 2004: NOTICE: Server started: Radiator 3.7.1
on www.prw.net
Fri Jan 23 14:07:41 2004: INFO: Trace level changed to 4
Fri Jan 23 14:07:41 2004: INFO: Trace level increased to 4
Fri Jan 23 14:07:46 2004: DEBUG: Packet dump:
*** Received from 208.249.78.3 port 34421 ....
Code: Access-Request
Identifier: 166
Authentic: 1234567890123456
Attributes:
User-Name = "****"
Service-Type = Framed-User
NAS-IP-Address = 203.63.154.1
NAS-Port = 1234
Called-Station-Id = "123456789"
Calling-Station-Id = "987654321"
NAS-Port-Type = Async
User-Password =
"<145><221><249><195><199>$<144><5><164><133><228><174><
1>H<30>x"
Fri Jan 23 14:07:46 2004: DEBUG: PreClientHook: Looking for
Connect-Speed
Fri Jan 23 14:07:46 2004: DEBUG: Handling request with Handler
'Client-Identifie
r=prtdsl'
Fri Jan 23 14:07:46 2004: DEBUG: prw-sessiondb Deleting session
for ****, 203.63.
154.1, 1234
Fri Jan 23 14:07:46 2004: DEBUG: do query is: 'delete from
RADONLINE where NASID
ENTIFIER='203.63.154.1' and NASPORT=01234':
Fri Jan 23 14:07:46 2004: INFO: AuthTEST handle_request: Received
from 208.249.7
8.3 port 34421
Fri Jan 23 14:07:46 2004: DEBUG: Handling with
Radius::AuthDYNADDRESS
Fri Jan 23 14:07:46 2004: DEBUG: Query is: 'select top 20
TIME_STAMP,YIADDR,SUBN
ETMASK,DNSSERVER from RADPOOL where POOL='dslpool1' and STATE=0
order by TIME_ST
AMP':
Fri Jan 23 14:07:46 2004: DEBUG: do query is: 'update RADPOOL set
STATE=1,
TIME_STAMP=1074881266,
EXPIRY=1077473266, USERNAME='****' where YIADDR='69.89.32.165'
and TIME_STAMP =10
74529930':
Fri Jan 23 14:07:46 2004: DEBUG: "update RADPOOL set STATE=1,
TIME_STAMP=1074881266,
EXPIRY=1077473266, USERNAME='****' where YIADDR='69.89.32.165'
and TIME_STAMP =10
74529930": $result=
Fri Jan 23 14:07:46 2004: DEBUG: do query is: 'select count(*)
from RADPOOL
where STATE=1
and TIME_STAMP=1074881266
and EXPIRY=1077473266
and USERNAME='****'
and YIADDR='69.89.32.165'':
Fri Jan 23 14:07:46 2004: DEBUG: "select count(*) from RADPOOL
where STATE=1
and TIME_STAMP=1074881266
and EXPIRY=1077473266
and USERNAME='****'
and YIADDR='69.89.32.165'" successful:
returned row
Fri Jan 23 14:07:46 2004: DEBUG: Access accepted for ****
Fri Jan 23 14:07:46 2004: DEBUG: Packet dump:
*** Sending to 208.249.78.3 port 34421 ....
Code: Access-Accept
Identifier: 166
Authentic: 1234567890123456
Attributes:
Framed-IP-Netmask = 255.255.255.255
Framed-IP-Address = 69.89.32.165
Regards,
William
-----Original Message-----
From: owner-radiator at open.com.au
[mailto:owner-radiator at open.com.au] On Behalf Of Hugh Irvine
Sent: Thursday, January 22, 2004 6:38 PM
To: William Hernandez
Cc: radiator at open.com.au
Subject: Re: (RADIATOR) Error in AddressAllocator SQL
Hello William -
Perhaps you could try setting the environment variables in the
Radiator
startup script rather than in a StartupHook.
Please let me know what you discover.
regards
Hugh
===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
More information about the radiator
mailing list