rpcbind/0022-Make-rpcinfo-p-support-IPv6-addresses-too.patch
2014-01-21 08:42:25 +00:00

48 lines
1.5 KiB
Diff

From b0921131b08c81c33498c6b0b91f8ddf55d73e2f Mon Sep 17 00:00:00 2001
From: Olaf Kirch <okir@suse.de>
Date: Mon, 20 Jan 2014 13:08:18 +0100
Subject: [PATCH 22/23] 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>
---
src/rpcinfo.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/rpcinfo.c b/src/rpcinfo.c
index 0da5628..2981240 100644
--- a/src/rpcinfo.c
+++ b/src/rpcinfo.c
@@ -484,7 +484,6 @@ pmapdump (argc, argv)
int argc;
char **argv;
{
- struct sockaddr_in server_addr;
struct pmaplist *head = NULL;
int socket = RPC_ANYSOCK;
struct timeval minutetimeout;
@@ -502,10 +501,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);
--
1.7.12.4