checking Packet-Type in post-proxy
Pshem Kowalczyk
pshem.k at gmail.com
Wed Oct 8 04:18:29 CEST 2014
Hi,
I have a setup with a frontend server that proxies all request to a number
of backend servers. Depending on the type of the reply packet it supposed
to do something extra (like log it into the database and update some
aspects of the reply for Access-Accept)
I've tried this setup:
post-proxy {
if (proxy-reply:Packet-Type == Access-Accept ){
....
}
but it doesn't seem to trigger:
(2) if (proxy-reply:Packet-Type == Access-Accept )
(2) if (proxy-reply:Packet-Type == Access-Accept ) -> FALSE
(2) } # post-proxy = noop
So I decided to map it to different attribute to see what the value
actually is:
post-proxy {
update control {
Filter-Id := "%{proxy-reply:Packet-Type}"
}
if (proxy-reply:Packet-Type == Access-Accept ){
....
}
And this seems to capture the content fine:
(2) post-proxy {
(2) update control {
(2) EXPAND %{proxy-reply:Packet-Type}
(2) --> Access-Accept
(2) Filter-Id := '"Access-Accept"'
(2) } # update control = noop
(2) if (proxy-reply:Packet-Type == Access-Accept )
(2) if (proxy-reply:Packet-Type == Access-Accept ) -> FALSE
(2) } # post-proxy = noop
For now I've settled on this setup:
post-proxy {
update control {
Filter-Id := "%{proxy-reply:Packet-Type}"
}
if (control:Filter-Id == 'Access-Accept'){
...
}
(2) post-proxy {
(2) update control {
(2) EXPAND %{proxy-reply:Packet-Type}
(2) --> Access-Accept
(2) Filter-Id := '"Access-Accept"'
(2) } # update control = noop
(2) if (control:Filter-Id == 'Access-Accept')
(2) if (control:Filter-Id == 'Access-Accept') -> TRUE
That works fine. I just wonder if there's a simpler way of checking the
type of the packet?
(Freeradius 3.0.4)
kind regards
Pshem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20141008/57d5c9ff/attachment-0001.html>
More information about the Freeradius-Users
mailing list