changeset 13463:887d3e73774c

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>
author Yuri Pankov <yuri.pankov@nexenta.com>
date Thu, 22 Sep 2011 06:54:35 -0700
parents 4d04e1a5e9ff
children e73ffd53b1d6
files usr/src/lib/librpcsvc/common/bindresvport.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/librpcsvc/common/bindresvport.c	Tue Sep 20 02:27:53 2011 -0400
+++ b/usr/src/lib/librpcsvc/common/bindresvport.c	Thu Sep 22 06:54:35 2011 -0700
@@ -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 @@
 		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 @@
 	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;
 		/*