diff options
author | brian <brian@FreeBSD.org> | 2009-07-19 19:01:30 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2009-07-19 19:01:30 +0000 |
commit | ec40877eda62735f117b38684a1eb92b75b172e5 (patch) | |
tree | cab5f5b74c7bbe053baee4f6f9876d3ae44517c8 /usr.sbin | |
parent | 80ed051e0ce8db1d25fa18e69fb262d52af7d891 (diff) | |
download | FreeBSD-src-ec40877eda62735f117b38684a1eb92b75b172e5.zip FreeBSD-src-ec40877eda62735f117b38684a1eb92b75b172e5.tar.gz |
Don't get stuck in an infinite loop comparing (short++ <= maxshort)
PR: 136893
Submitted by: Aragon Gouveia - aragon at phat dot za dot net (mostly)
Approved by: re (kib)
MFC after: 3 weeks
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/nat_cmd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/ppp/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c index b4d6ad2..48f894a 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; } |