hi,

it is  a couple of years and versions back when i did something with radiator 
and perl.
However recently i started to upgrade that old setup with radiator 4.13.1.
Starting with some basics merging old configs and try to fix some old 
inconsistencies i noticed that a lot has changed.

One of my problems now is that i try to use the eap hook to have the inner 
identity of EAP sessions in my logging but also in the RADONLINE table. The 
problem i encounter is when using the provided eap_anon_hook that with one user 
the right username is logged, however the next user is logged with the username 
of the first user in the RADLASTAUTH table. Looking in the code learns that the 
code is differentiating between sessions/users in that table based on NASID and 
NASport. That is not working for me because those are the same for every 
connecting WiFi user (at least at our infra). I need another attribute for 
this, so i thought of the Acct-Session-Id, however i was not able to get these 
in the PostAuthhook fase.

Another attribute i can use is the Calling_Station_ID, however the problem 
seems that there is no function to actually read those attributes other then 
the getAttrByNum and that one does not work properly in the PreProcessingHook 
(ERR: Error in PreProcessingHook(): Can't call method "getAttrByNum" on an 
undefined value at)

I found an article 
:http://www.open.com.au/pipermail/radiator/2008-December/015237.html suggesting 
to use my $callingstationid = ${$p}->{outerRequest}->get_attr('Attribute_name');
However that result in the error ERR: Error in PreProcessingHook(): Can't call 
method "get_attr" on an undefined value at

After a couple of days searching on the web, trying to get it to work and 
completely losing my sanity i decided to change the Radius.pm, adding my own 
get_attr function:

sub getAttrByName
{
my ($self, $name) = @_;
unless (exists $self->{CachedAttrs}{$name})
{
# Get via AttrVal de attribute
$self->{CachedAttrs}{$name} = $self->get_attr($name);
}
}

in combination with: my $callingstationid = 
$dbh->quote(${$p}->getAttrByName('Calling-Station-Id')); This seems to work how 
ever changing the Radius.pm is not the most maintainable method.

Is there a proper way to do this that i missed or just did not think about?

Regards,

Erwin
_______________________________________________
radiator mailing list
radiator@open.com.au
http://www.open.com.au/mailman/listinfo/radiator

Reply via email to