How to use reference instead of printing attribute

Castel, Nicolas nicolas.a.castel at capgemini.com
Thu Mar 26 10:14:47 CET 2015


Hi,

We currently use 3.0.x version of freeRADIUS.

I try to follow recommendations found in unlang man concerning use of attribute references.

Extract from man:
"We recommend using attribute references instead of printing attributes to a string, e.g. (User-Name == "%{Filter-Id}").  Attribute references will be
       faster and more efficient."

It seems not to work correctly with my configuration.

An example of debug which works with printing of attribute:

(2)     } # if ("%{proxy-reply:Packet-Type}" == "Access-Accept")  = ok
(2)     if ("%{proxy-reply:Packet-Type}" == "Access-Challenge") {
(2)     EXPAND %{proxy-reply:Packet-Type}
(2)        --> Access-Accept
(2)     if ("%{proxy-reply:Packet-Type}" == "Access-Challenge")  -> FALSE
(2)   } # post-proxy = ok

Corresponding configuration:

if ("%{proxy-reply:Packet-Type}" == "Access-Challenge") {

The same example using reference which do not work:

(2)     } # if ("%{proxy-reply:Packet-Type}" == "Access-Accept")  = ok
(2)     if (&proxy-reply:Packet-Type == "Access-Challenge") {
(2)     ERROR: Failed retrieving values required to evaluate condition
(2)   } # post-proxy = ok

Corresponding configuration:

if (&proxy-reply:Packet-Type == "Access-Challenge") {

Another test using directly integer value

(2)     } # if ("%{proxy-reply:Packet-Type}" == "Access-Accept")  = ok
(2)     if (&proxy-reply:Packet-Type == 11) {
(2)     ERROR: Failed retrieving values required to evaluate condition
(2)   } # post-proxy = ok

Corresponding configuration:

if (&proxy-reply:Packet-Type == 11) {

Same thing using following configuration:

(2)     if (&proxy-reply:Packet-Type == Access-Challenge) {
(2)     ERROR: Failed retrieving values required to evaluate condition

Is there some limitations using references ?

Weird thing is that reference works with Auth-Type attribute used in another place in my configuration:

(6)     if (&control:Auth-Type == WIFI-GW-Auth) {
(6)     if (&control:Auth-Type == WIFI-GW-Auth)  -> TRUE

Corresponding configuration:
if (&control:Auth-Type == WIFI-GW-Auth) {

Thanks for help.

Nicolas Castel

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.


More information about the Freeradius-Users mailing list