checking Packet-Type in post-proxy
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
On 8 Oct 2014, at 03:18, Pshem Kowalczyk <pshem.k@gmail.com> wrote:
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:
Yes Packet-Type is a virtual attribute only accessible via xlat. proxy-reply:Packet-Type != "%{proxy-reply:Packet-Type}" Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (3)
-
Alan DeKok -
Arran Cudbard-Bell -
Pshem Kowalczyk