[j-nsp] terminate endless loop in SLAX

Martin T m4rtntns at gmail.com
Tue Jun 26 05:56:15 EDT 2018


On Mon, Jun 25, 2018 at 7:32 PM Phil Shafer <phil at juniper.net> wrote:
>
> Martin T writes:
> >Hi!
> >
> >Is there a way to terminate endless loop in SLAX? For example, if I
> >configure something as simple as that:
> >
> >match / {
> >    <op-script-results> {
> >        while ( true() ) {
> >            terminate;
> >        }
>
> It's processing the terminate, but then it continues to "skip" over
> the rest of the entries, thinking that it's a set of nodes instead
> of a condition.  So it really, really, quickly loops forever.  Doh!
>
> I'll open a bug report and work on the fix.  There is no workaround.
> Apologies for the problem.
>
> Thanks,
>  Phil

Thanks Phil! So in short, at the moment "terminate" statement inside
the while loop works in a way that when "terminate" statement is
executed, then immediately next iteration of while loop is started if
while expression returns true and this will loop infinitely? If this
while expression returns false, then terminate statement was the last
thing processed by the script and script exits. At least based on my
tests it seems to work like that.


Martin


More information about the juniper-nsp mailing list