Return or not return

Franks Andy (IT Technical Architecture Manager) Andy.Franks at
Thu Jul 7 13:46:57 CEST 2016

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.
I found this out the hard way when setting up a nas to do periodic updates and seeing that it was just sending a barrage of start packets and whinging that it couldn't talk to the radius server. The last part of my accounting statement did a check to see if this was an interim-update, and if not, do a return. The outcome was that the radius server exits the accounting bit without sending a response back, which is by design.
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? If not, I'll have to end up trying to put the code that has returns in as the last bit of an auth or possibly accounting section or nesting everything up which makes for awkward structure.
I've tried using noop, ok or similar, setting the module return default=1 to try and "catch" the return, but it's obviously not supposed to work like that.
I have read but I'm still struggling to match what I'm after.


More information about the Freeradius-Users mailing list