HEX Stripping using attr_rewrite

Simon Allard Simon.Allard at team.orcon.net.nz
Thu Jun 5 03:30:16 CEST 2014


> 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.

I am using freeradius 2.1.8

Cheers.
Simon




More information about the Freeradius-Users mailing list