Hi everyone. Im trying to get RLM_perl to respond with two Cisco-AVPair lines (what would usually be done with += in users) Unfortunately only the first seems to get sent back to the nas - debug output follows rlm_perl: Added pair Cisco-AVPair = ip:dns-servers=10.10.10.10 10.10.10.12 rlm_perl: Added pair Cisco-AVPair = ip:route=10.10.0.0 255.255.255.0 rlm_perl: Added pair Framed-IP-Address = 10.10.10.12 rlm_perl: Added pair Framed-IP-Netmask = 255.255.255.255 rlm_perl: Added pair Auth-Type = perl rlm_perl: Added pair Service-Type = Framed-User rlm_perl: Added pair Auth-Type = System modcall[authenticate]: module "perl" returns ok for request 25 modcall: group Auth-Type returns ok for request 25 Sending Access-Accept of id 56 to 127.0.0.1:34529 Cisco-AVPair = "ip:dns-servers=10.10.10.10 10.10.10.12" Framed-IP-Address = 10.10.10.10 Framed-IP-Netmask = 255.255.255.255 Service-Type = Framed-User As you can see, rlm_perl logs that it is adding the pair twice but only the first is returned. I've gone so far as to looking at the code for rlm_perl and it looks to me like it should have worked from what i have done, the coder has asked for a reference to an array. my code basically does this push(@avpairs,'ip:dns-servers=$dns1 $dns2'); push(@avpairs,"ip:route=$$thisroute{network} $$thisroute{subnet}"); $RAD_REPLY{'Cisco-AVPair'}=\@avpairs; Anyone any ideas? Doesn't look like many people use rlm_perl yet
Im trying to get RLM_perl to respond with two Cisco-AVPair lines (what would usually be done with += in users)
So try that with rlm_perl
the server functions that update the list need to see the += operator.
I don't believe it works like that with rlm_perl, as += in perl means 'add as an integer to the scalar specified'. There is no way of specifying the operator in your reply items, the code within rlm_perl asks for you to give it a scalar reference, which is what ive done.
On Wednesday 25 January 2006 00:17, Alan Lumb wrote:
push(@avpairs,'ip:dns-servers=$dns1 $dns2'); push(@avpairs,"ip:route=$$thisroute{network} $$thisroute{subnet}"); $RAD_REPLY{'Cisco-AVPair'}=\@avpairs;
This code works for me on freeradius 1.1.0. Which version you are using ? -- Best Regards, Boian Jordanov SNE Orbitel - Next Generation Telecom tel. +359 2 4004 723 tel. +359 2 4004 002
1.0.5, could potentially be the problem but it didn't look like the code had changed much. I have a version 1.1.0 server in transit at the moment so will test it on this once I have it back online. At least i'm not going mad and the perl method im using is correct, thanks for your help!
On Wednesday 25 January 2006 00:17, Alan Lumb wrote:
push(@avpairs,'ip:dns-servers=$dns1 $dns2'); push(@avpairs,"ip:route=$$thisroute{network} $$thisroute{subnet}"); $RAD_REPLY{'Cisco-AVPair'}=\@avpairs;
This code works for me on freeradius 1.1.0. Which version you are using ?
-- Best Regards, Boian Jordanov SNE Orbitel - Next Generation Telecom tel. +359 2 4004 723 tel. +359 2 4004 002 - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan Lumb -
Boyan Jordanov -
Joe Maimon