From d762223f32d8cac02a44b08dfe6d1bb5843398a6 Mon Sep 17 00:00:00 2001 From: Yuri Pankov Date: Thu, 22 Sep 2011 06:54:35 -0700 Subject: 1541 NFS client doesn't use privileged ports for mount requests in IPv6 case Reviewed by: Dan Kruchinin Reviewed by: Garrett D'Amore Reviewed by: Dan McDonald Reviewed by: Igor Kozhukhov Approved by: Eric Schrock --- usr/src/lib/librpcsvc/common/bindresvport.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'usr/src') 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; /* -- cgit v1.2.3