summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorMarcel Telka <marcel.telka@nexenta.com>2015-02-16 20:18:16 +0100
committerDan McDonald <danmcd@omniti.com>2015-02-19 14:17:35 -0500
commit20d0ade92f2ccd1095364cf9ca5807ad3dee6081 (patch)
tree7ba450b05fa64af5c7aaf542f9786d37c2a2bba7 /usr/src/cmd
parent8f88a51fa5d22e056a70484fd9496b2dee9876b0 (diff)
downloadillumos-gate-20d0ade92f2ccd1095364cf9ca5807ad3dee6081.tar.gz
5631 rpcinfo(1M) is unable to connect to localhost
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Reviewed by: Richard Elling <richard.elling@richardelling.com> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/rpcinfo/rpcinfo.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/usr/src/cmd/rpcinfo/rpcinfo.c b/usr/src/cmd/rpcinfo/rpcinfo.c
index f415c24f80..702a628980 100644
--- a/usr/src/cmd/rpcinfo/rpcinfo.c
+++ b/usr/src/cmd/rpcinfo/rpcinfo.c
@@ -17,7 +17,13 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
+ */
+
+/*
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ */
+
+/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -39,7 +45,7 @@
*/
/*
- * We are for now defining PORTMAP here. It doesnt even compile
+ * We are for now defining PORTMAP here. It doesn't even compile
* unless it is defined.
*/
#ifndef PORTMAP
@@ -57,7 +63,6 @@
#include <rpc/nettype.h>
#include <netdir.h>
#include <rpc/rpcent.h>
-#include <sys/utsname.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -488,7 +493,6 @@ pmapdump(argc, argv)
struct rpcent *rpc;
enum clnt_stat clnt_st;
struct rpc_err err;
- struct utsname utsname;
char *host;
if (argc > 1) {
@@ -497,12 +501,11 @@ pmapdump(argc, argv)
}
if (argc == 1) {
host = argv[0];
- get_inet_address(&server_addr, host);
} else {
- (void) uname(&utsname);
- host = utsname.nodename;
- get_inet_address(&server_addr, host);
+ host = HOST_SELF_CONNECT;
}
+ get_inet_address(&server_addr, host);
+
minutetimeout.tv_sec = 60;
minutetimeout.tv_usec = 0;
server_addr.sin_port = htons(PMAPPORT);
@@ -715,7 +718,6 @@ rpcbdump(dumptype, netid, argc, argv)
struct rpcbdump_short *rs, *rs_tail;
enum clnt_stat clnt_st;
struct rpc_err err;
- struct utsname utsname;
struct rpcbdump_short *rs_head = NULL;
if (argc > 1) {
@@ -725,8 +727,7 @@ rpcbdump(dumptype, netid, argc, argv)
if (argc == 1) {
host = argv[0];
} else {
- (void) uname(&utsname);
- host = utsname.nodename;
+ host = HOST_SELF_CONNECT;
}
if (netid == NULL) {
if (loopback_netid == NULL) {
@@ -1061,7 +1062,6 @@ rpcbgetstat(argc, argv)
rpcbs_addrlist *pa;
rpcbs_rmtcalllist *pr;
int cnt, flen;
- struct utsname utsname;
#define MAXFIELD 64
char fieldbuf[MAXFIELD];
#define MAXLINE 256
@@ -1085,8 +1085,7 @@ rpcbgetstat(argc, argv)
if (argc >= 1) {
host = argv[0];
} else {
- (void) uname(&utsname);
- host = utsname.nodename;
+ host = HOST_SELF_CONNECT;
}
if (loopback_netid != NULL) {
client = getclnthandle(host, loopback_nconf, RPCBVERS4, NULL);