diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/librpcsvc/common/bindresvport.c | 14 |
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; /* |