Return or not return

Alan DeKok aland at
Thu Jul 7 14:21:41 CEST 2016

On Jul 7, 2016, at 7:46 AM, Franks Andy (IT Technical Architecture Manager) <Andy.Franks at> wrote:
> Hi all,
>  Another basic question. I feel like a dunce coming here. Oh well, here goes :
>  I'm confused about the correct way to exit processing of a policy/unlang bit of "code". I guess I'm used to treating them like subroutines, but that may be naughty behaviour since I'm not sure return is exactly what I want, in fact I'm fairly sure it isn't, as a way of halting processing of a policy based on condition checks.

  Policies aren't subroutines.  They're essentially copied in place.

  Note that they're not *documented* as subroutines.  We hope to fix that for 4.0.

> Anyway, is there a better way of stopping a set of checks etc for a policy or module without using if .. else throughout the policy, and continuing the rest of the authorisation or accounting section?

  Nope.  Just use if/else.  It's imperfect, but it works.

  Alan DeKok.

More information about the Freeradius-Users mailing list