Re: rlm_perl hash issue

This is a discussion on Re: rlm_perl hash issue within the FreeRADIUS Users forums, part of the Networking and Network Related category; try putting them in perenthesis re: $RAD_REPLY{'Recv-Limit'} = ($BytesAvail - $BytesUsed); $RAD_REPLY{'Xmit-Limit'} = ($BytesAvail - $BytesUsed); The array may be ...


Go Back   Usenet Forums > Networking and Network Related > FreeRADIUS Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-23-2005
Kenneth Grady
 
Posts: n/a
Default Re: rlm_perl hash issue

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 With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:12 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0