diff --git a/Radius/Packet.pm b/Radius/Packet.pm index 746ebb5984152cd3ab8a96af38e51e55409d04df..941568ed36ebdadf3a1be417957ec831eee5ecae 100644 --- a/Radius/Packet.pm +++ b/Radius/Packet.pm @@ -131,7 +131,11 @@ sub rawattr my @attr = $self->_attributes; for (my $i = $#attr; $i >= 0; $i-- ) { - return $attr[$i][2] if $attr[$i][0] eq $name; + # Check if this is the attr we're after + if ($attr[$i][0] eq $name) { + # If it is, return the raw attribute if it exists, else return the nicer dict one + return defined($attr[$i][2]) ? $attr[$i][2] : $attr[$i][1]; + } } return; }