On Wed, Mar 23, 2005 at 01:48:43PM +0200, Peter Nixon wrote: > On Wednesday 23 March 2005 09:18, Chris Knipe wrote: > > ----- Original Message ----- > > From: "Chris Knipe" <[EMAIL PROTECTED]> > > To: <freeradius-users@lists.freeradius.org> > > Sent: Wednesday, March 23, 2005 5:31 AM > > Subject: Re: rlm_perl hash issue > > > > >> "Chris Knipe" <[EMAIL PROTECTED]> wrote: > > >>> 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 > > >> > > >> Hmm... that looks like rlm_perl isn't looking in the right place for > > >> the values of the perl variables. Not that I know anything about > > >> Perl.... > > >> > > >>> Strange as well, is that format_bytes successfully completes the > > >>> formating > > >>> and the calculation. Thus, there is also nothing wrong in my code. > > >> > > >> Perl keeps values for variables in multiple formats. If rlm_perl > > >> isn't looking in the right place, that may be the problem. > > > > Just further to this issue... > > > > Works: > > $RAD_REPLY{'Recv-Limit'} = $BytesAvail; > > > > does NOT Work: > > my $tmpBytes = $BytesAvail - $BytesUsed; > > $RAD_REPLY{'Recv-Limit'} = $tmpBytes; > > > > And then the original also obviously does not work. > > $RAD_REPLY{'Recv-Limit'} = $BytesAvail - $BytesUsed; > > > > Thus, it seems it makes it virtually impossible to do any form of > > "calculation" on data to use during authentication with rlm_perl.... > > Eeeek. There is definitely a bug somewhere :-( >
Fixed in CVS. Please use recent cvs snapshot. Before rlm_perl expects that scalar value of RAD_xxx hash is character value, now it can be string or integer. There is only one limitation an ip address should be returned as character value i.e. $RAD_REPLY{'Framed-Ip-Address'} = "127.0.0.1"; -- Best Regards, Boian Jordanov SNE Orbitel - the Internet Company tel. +359 2 4004 723 - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html