summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-07-26 07:52:21 +0000
committeriedowse <iedowse@FreeBSD.org>2002-07-26 07:52:21 +0000
commit36cd9c677d648258a12bef455295e45b5f950815 (patch)
tree2c512985b51775d3d4e8c88cf5c2af953f016c94
parentdef36fc8979cc9fe2fe6b2d62f455695d43c28df (diff)
downloadFreeBSD-src-36cd9c677d648258a12bef455295e45b5f950815.zip
FreeBSD-src-36cd9c677d648258a12bef455295e45b5f950815.tar.gz
Revert part of revision 1.10, as it broke portmap lookups for IPv4
TCP clients. The problem was that a struct netconfig returned by getnetconfigent() was being treated as a handle for __rpc_getconf(), which certainly isn't right. The tirpc-99 code uses __rpc_setconf("udp")/__rpc_getconf() to find the IPv4 udp netconfig, but our implementation of these functions seem happy to return IPv6 entries, so we can't use them. By reverting to the old version, we are hard-coding the name of the udp4 netid. Tracked down by: Bakul Shah <bakul@bitblocks.com>
-rw-r--r--lib/libc/rpc/rpcb_clnt.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c
index b47f36b..aa26275 100644
--- a/lib/libc/rpc/rpcb_clnt.c
+++ b/lib/libc/rpc/rpcb_clnt.c
@@ -685,7 +685,7 @@ __rpcbind_is_up()
nconf = NULL;
localhandle = setnetconfig();
- while (nconf = getnetconfig(localhandle)){
+ while ((nconf = getnetconfig(localhandle)) != NULL) {
if (nconf->nc_protofmly != NULL &&
strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0)
break;
@@ -777,19 +777,13 @@ __rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
*/
if (strcmp(nconf->nc_proto, NC_TCP) == 0) {
struct netconfig *newnconf;
- void *handle;
- if ((handle = getnetconfigent("udp")) == NULL) {
- rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
- return (NULL);
- }
- if ((newnconf = __rpc_getconf(handle)) == NULL) {
- __rpc_endconf(handle);
+ if ((newnconf = getnetconfigent("udp")) == NULL) {
rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
return (NULL);
}
client = getclnthandle(host, newnconf, &parms.r_addr);
- __rpc_endconf(handle);
+ freenetconfigent(newnconf);
} else {
client = getclnthandle(host, nconf, &parms.r_addr);
}
OpenPOWER on IntegriCloud