Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/rpcbind Fix botched reserved port check for the -L ...



details:   https://anonhg.NetBSD.org/src/rev/d04ed0cff39d
branches:  trunk
changeset: 487475:d04ed0cff39d
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Thu Jun 08 08:21:42 2000 +0000

description:
Fix botched reserved port check for the -L option case. From
IWAMOTO Toshihiro <iwamoto%sat.t.u-tokyo.ac.jp@localhost>, PR 10321

Use IPV6PORT_RESERVED in the INET6 case, for consistency.

diffstat:

 usr.sbin/rpcbind/security.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r 974b7aaf283a -r d04ed0cff39d usr.sbin/rpcbind/security.c
--- a/usr.sbin/rpcbind/security.c       Thu Jun 08 07:30:47 2000 +0000
+++ b/usr.sbin/rpcbind/security.c       Thu Jun 08 08:21:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: security.c,v 1.3 2000/06/04 12:06:44 fvdl Exp $        */
+/*     $NetBSD: security.c,v 1.4 2000/06/08 08:21:42 fvdl Exp $        */
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -134,14 +134,14 @@
                        return 0;
                sin = (struct sockaddr_in *)addr;
                return ((sin->sin_addr.s_addr == htonl(INADDR_LOOPBACK)) &&
-                   (sin->sin_port < IPPORT_RESERVED));
+                   (htons(sin->sin_port) < IPPORT_RESERVED));
 #ifdef INET6
        case AF_INET6:
                if (!oldstyle_local)
                        return 0;
                sin6 = (struct sockaddr_in6 *)addr;
                return (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) &&
-                   (sin6->sin6_port < IPPORT_RESERVED));
+                   (htons(sin6->sin6_port) < IPV6PORT_RESERVED));
 #endif
        case AF_LOCAL:
                return 1;



Home | Main Index | Thread Index | Old Index