diff options
author | Olaf Kirch <okir@suse.de> | 2015-02-03 11:16:52 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2015-02-04 08:03:38 -0500 |
commit | a9a2731cbb34eb9b54bbb579b6e600dba9a103dc (patch) | |
tree | 660622685d260a98b0f7b58b07584fd7ef34b0f3 | |
parent | f83927337df8086b9649714514779d04054c0c64 (diff) | |
download | rpcbind-a9a2731cbb34eb9b54bbb579b6e600dba9a103dc.tar.gz |
Make rpcinfo -p support IPv6 addresses, too
While this is not strictly necessary (you can use "rpcinfo <hostname>"
instead), some older scripts may rely on rpcinfo to work with
just about any hostname. Let's be gentle with them. It doesn't
cost us much.
Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | src/rpcinfo.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rpcinfo.c b/src/rpcinfo.c index 3fea753..7deb96c 100644 --- a/src/rpcinfo.c +++ b/src/rpcinfo.c @@ -520,7 +520,6 @@ pmapdump (argc, argv) int argc; char **argv; { - struct sockaddr_in server_addr; struct pmaplist *head = NULL; int socket = RPC_ANYSOCK; struct timeval minutetimeout; @@ -538,10 +537,13 @@ pmapdump (argc, argv) if (argc == 1) { host = argv[0]; - get_inet_address (&server_addr, host); - server_addr.sin_port = htons (PMAPPORT); - client = clnttcp_create (&server_addr, PMAPPROG, PMAPVERS, - &socket, 50, 500); + + /* This is a little bit more complicated than it should be. + * ip_getclient will do an rpcb_getaddr call to identify the + * port of the portmapper - but it works, and it's easier than + * creating a copy of ip_getclient that avoids the getaddr call. + */ + client = ip_getclient(host, PMAPPROG, PMAPVERS, "tcp"); } else client = local_rpcb (PMAPPROG, PMAPVERS); |