Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dist/ipf/netinet Add 1 to the port range so the range is...



details:   https://anonhg.NetBSD.org/src/rev/06e3b564fd49
branches:  trunk
changeset: 761987:06e3b564fd49
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 12 21:23:31 2011 +0000

description:
Add 1 to the port range so the range is inclusive as documented.

diffstat:

 sys/dist/ipf/netinet/ip_nat.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 169a5c61f182 -r 06e3b564fd49 sys/dist/ipf/netinet/ip_nat.c
--- a/sys/dist/ipf/netinet/ip_nat.c     Sat Feb 12 19:33:16 2011 +0000
+++ b/sys/dist/ipf/netinet/ip_nat.c     Sat Feb 12 21:23:31 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat.c,v 1.42 2011/02/12 18:14:21 christos Exp $     */
+/*     $NetBSD: ip_nat.c,v 1.43 2011/02/12 21:23:31 christos Exp $     */
 
 /*
  * Copyright (C) 1995-2003 by Darren Reed.
@@ -120,7 +120,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.42 2011/02/12 18:14:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.43 2011/02/12 21:23:31 christos Exp $");
 #else
 static const char sccsid[] = "@(#)ip_nat.c     1.11 6/5/96 (C) 1995 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_nat.c,v 2.195.2.130 2010/03/16 02:24:52 darrenr Exp";
@@ -2064,7 +2064,7 @@
                                port = np->in_pnext;
                        } else {
                                in_port_t d = ntohs(np->in_pmax) -
-                                   ntohs(np->in_pmin);
+                                   ntohs(np->in_pmin) + 1;
                                if (d)
                                        port = ipf_random() % d;
                                else



Home | Main Index | Thread Index | Old Index