diff --git a/usr.sbin/ppp/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c index b4d6ad29377b..48f894aedc47 100644 --- a/usr.sbin/ppp/nat_cmd.c +++ b/usr.sbin/ppp/nat_cmd.c @@ -175,7 +175,7 @@ nat_RedirectPort(struct cmdargs const *arg) return -1; } - while (laliasport <= haliasport) { + do { link = LibAliasRedirectPort(la, localaddr, htons(llocalport), remoteaddr, htons(lremoteport), aliasaddr, htons(laliasport), @@ -187,10 +187,9 @@ nat_RedirectPort(struct cmdargs const *arg) return 1; } llocalport++; - laliasport++; if (hremoteport) lremoteport++; - } + } while (laliasport++ < haliasport); return 0; }