try putting them in perenthesis re:
$RAD_REPLY{'Recv-Limit'} = ($BytesAvail - $BytesUsed);
$RAD_REPLY{'Xmit-Limit'} = ($BytesAvail - $BytesUsed);
The array may be adding the data in as a string.

On Tue, 2005-03-22 at 20:13, Chris Knipe wrote:
> Lo all,
> 
> This has been to the perl mailing lists as well, there is nothing wrong with 
> the code as far as every one knows... rlm_perl just doesn't like this for 
> some reason....
> 
> Snipets of the script in question:
>         $RAD_REPLY{'Acct-Interim-Interval'} = "300";
>         $RAD_REPLY{'MS-MPPE-Encryption-Policy'} = "1";
>         $RAD_REPLY{'MS-MPPE-Encryption-Types'} = "LS";
>         $RAD_REPLY{'Rate-Limit'} = "256k/512k";
>         $RAD_REPLY{'Recv-Limit'} = $BytesAvail - $BytesUsed;
>         $RAD_REPLY{'Xmit-Limit'} = $BytesAvail - $BytesUsed;
>         $RAD_REPLY{'Reply-Message'} = "You have " . 
> $za->format_bytes($BytesAvail - $BytesUsed) . " available.";
>         $RAD_REPLY{'Session-Timeout'} = "86400";
> 
> Righty.  From the above, EVERYTHING gets returned (radiusd -X reports that 
> rlm_perl added the values) with the EXCEPTION of Recv-Limit and Xmit-Limit. 
> *IF* I add physical values to Recv-Limit, Xmit-Limit, then radiusd -X finds 
> the attributes and add them to the reply packet.
> 
> So basically:
>         $RAD_REPLY{'Recv-Limit'} = $BytesAvail - $BytesUsed;
>         $RAD_REPLY{'Xmit-Limit'} = $BytesAvail - $BytesUsed;
> doesn't work
>         $RAD_REPLY{'Recv-Limit'} = 23423424;
>         $RAD_REPLY{'Xmit-Limit'} = 23234242;
> works
> 
> Strange as well, is that format_bytes successfully completes the formating 
> and the calculation.  Thus, there is also nothing wrong in my code.  A 
> further test I did to verify my code, which also worked (and not on FR - 
> rlm_perl):
> 
> <snip>
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> 
> use Data::Dumper 'Dumper';
> 
> my( $BytesAvail, $BytesUsed ) = (20971521, 1);
> 
> {
>     my %RAD_REPLY;
>     $RAD_REPLY{'Recv-Limit'} = "20971520";
>     $RAD_REPLY{'Xmit-Limit'} = "20971520";
>     print Dumper \%RAD_REPLY;
> }
> 
> 
> 
> {
>     my %RAD_REPLY;
>     $RAD_REPLY{'Recv-Limit'} = $BytesAvail - $BytesUsed;
>     $RAD_REPLY{'Xmit-Limit'} = $BytesAvail - $BytesUsed;
>     print Dumper \%RAD_REPLY;
> }
> 
> __END__
> </snip>
> 
> also works flawlessly.....
> 
> Hope someone can give me some clarification.....
> 
> --
> Chris. 
> 
> 
> - 
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to