summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2011-09-22 06:54:35 -0700
committerYuri Pankov <yuri.pankov@nexenta.com>2011-09-22 06:54:35 -0700
commitd762223f32d8cac02a44b08dfe6d1bb5843398a6 (patch)
tree6b0d1c38f1191e05d1e81ed9d380a7c88f4627cc /usr/src
parent86dc0e004183257ff0546a5d165d850f4908650b (diff)
downloadillumos-gate-d762223f32d8cac02a44b08dfe6d1bb5843398a6.tar.gz
1541 NFS client doesn't use privileged ports for mount requests in IPv6 case
Reviewed by: Dan Kruchinin <dkruchinin@acm.org> Reviewed by: Garrett D'Amore <garrett.damore@gmail.com> Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Approved by: Eric Schrock <Eric.Schrock@delphix.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/lib/librpcsvc/common/bindresvport.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr/src/lib/librpcsvc/common/bindresvport.c b/usr/src/lib/librpcsvc/common/bindresvport.c
index 69bf6bf4b9..d8e9a098e5 100644
--- a/usr/src/lib/librpcsvc/common/bindresvport.c
+++ b/usr/src/lib/librpcsvc/common/bindresvport.c
@@ -18,10 +18,11 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- */
-/*
+ *
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -32,8 +33,6 @@
* under license from the Regents of the University of California.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* XXX This routine should be changed to use
* ND_CHECK_RESERVED_PORT and ND_SET_RESERVED_PORT
@@ -85,7 +84,7 @@ __clnt_bindresvport(cl)
return (-1);
if ((nconf->nc_semantics != NC_TPI_CLTS) ||
(strcmp(nconf->nc_protofmly, NC_INET) &&
- strcmp(nconf->nc_protofmly, NC_INET)) ||
+ strcmp(nconf->nc_protofmly, NC_INET6)) ||
strcmp(nconf->nc_proto, NC_UDP)) {
freenetconfigent(nconf);
return (0); /* not udp - don't need resv port */
@@ -159,7 +158,10 @@ __clnt_bindresvport(cl)
port = (getpid() % NPORTS) + STARTPORT;
for (i = 0; i < NPORTS; i++) {
- sin->sin_port = htons(port++);
+ if (ipv6_fl == TRUE)
+ sin6->sin6_port = htons(port++);
+ else
+ sin->sin_port = htons(port++);
if (port > ENDPORT)
port = STARTPORT;
/*