summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/ppp/nat_cmd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/ppp/ppp/nat_cmd.c b/usr.sbin/ppp/ppp/nat_cmd.c
index 8930884a819..735e71d7286 100644
--- a/usr.sbin/ppp/ppp/nat_cmd.c
+++ b/usr.sbin/ppp/ppp/nat_cmd.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: nat_cmd.c,v 1.26 2005/07/26 01:32:25 brad Exp $
+ * $OpenBSD: nat_cmd.c,v 1.27 2009/08/31 08:01:33 claudio Exp $
*/
#include <sys/param.h>
@@ -173,7 +173,7 @@ nat_RedirectPort(struct cmdargs const *arg)
return -1;
}
- while (laliasport <= haliasport) {
+ do {
link = PacketAliasRedirectPort(localaddr, htons(llocalport),
remoteaddr, htons(lremoteport),
aliasaddr, htons(laliasport),
@@ -185,10 +185,9 @@ nat_RedirectPort(struct cmdargs const *arg)
return 1;
}
llocalport++;
- laliasport++;
if (hremoteport)
lremoteport++;
- }
+ } while (laliasport++ < haliasport);
return 0;
}