HEX Stripping using attr_rewrite

Arran Cudbard-Bell a.cudbardb at freeradius.org
Thu Jun 5 12:17:28 CEST 2014


On 5 Jun 2014, at 02:30, Simon Allard <Simon.Allard at team.orcon.net.nz> wrote:

> 
>> A way that doesn't rely on FR being \0 safe is to do something like:
>> 
>> if ("%{hex:ADSL-Agent-Remote-Id}" =~ /^....([0-9a-f]+)$/) {
>> 	update request {
>> 		Tmp-Octets-0 := "0x%{1}"
>> 	}
>> 	update request {
>> 		ADSL-Agent-Remote-ID := "%{string:Tmp-Octets-0}"
>> 	}
>> }
>> 
>> But that's pretty nasty.
> 
> Hi Aaran
> 
> Thank you for that. You are right, it does look nasty :)
> 
> I must have missed a step somewhere, as I am seeing this in the debug when using your ulang code.
> 
> ++++++? if ("%{hex:ADSL-Agent-Remote-Id}" =~ /^....([0-9a-f]+)$/)
> WARNING: Unknown module "hex" in string expansion "%"
> 
> There doesn't seem to be a hex loadable module.

Hm, your version of freeradius is too old and doesn't have the %{hex:} expansion.

Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 881 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20140605/9ecad115/attachment.pgp>


More information about the Freeradius-Users mailing list