rpcbind/0024-rpcinfo-remove-obsolete-function-get_inet_address.patch

77 lines
2.1 KiB
Diff
Raw Normal View History

From c2d5de2c81e9d8d4cdaaafa2b7ae925c6e62c5ad Mon Sep 17 00:00:00 2001
From: Olaf Kirch <okir@suse.de>
Date: Mon, 20 Jan 2014 13:09:46 +0100
Subject: [PATCH 24/24] rpcinfo: remove obsolete function get_inet_address
Signed-off-by: Olaf Kirch <okir@suse.de>
---
src/rpcinfo.c | 45 ---------------------------------------------
1 file changed, 45 deletions(-)
diff --git a/src/rpcinfo.c b/src/rpcinfo.c
index 2981240..2c7d897 100644
--- a/src/rpcinfo.c
+++ b/src/rpcinfo.c
@@ -116,7 +116,6 @@ struct rpcbdump_short
#ifdef PORTMAP
static void ip_ping (u_short, char *, int, char **);
static void pmapdump (int, char **);
-static void get_inet_address (struct sockaddr_in *, char *);
static CLIENT *ip_getclient(const char *hostname, rpcprog_t prognum, rpcvers_t versnum, const char *proto);
#endif
@@ -574,50 +573,6 @@ pmapdump (argc, argv)
}
}
-static void
-get_inet_address (addr, host)
- struct sockaddr_in *addr;
- char *host;
-{
- struct netconfig *nconf;
- struct addrinfo hints, *res;
- int error;
-
- (void) memset ((char *) addr, 0, sizeof (*addr));
- addr->sin_addr.s_addr = inet_addr (host);
- if (addr->sin_addr.s_addr == -1 || addr->sin_addr.s_addr == 0)
- {
- if ((nconf = __rpc_getconfip ("udp")) == NULL &&
- (nconf = __rpc_getconfip ("tcp")) == NULL)
- {
- fprintf (stderr, "rpcinfo: couldn't find a suitable transport\n");
- exit (1);
- }
- else
- {
- memset (&hints, 0, sizeof hints);
- hints.ai_family = AF_INET;
- if ((error = getaddrinfo (host, "rpcbind", &hints, &res)) != 0 &&
- (error = getaddrinfo (host, "portmapper", &hints, &res)) != 0)
- {
- fprintf (stderr, "rpcinfo: %s: %s\n",
- host, gai_strerror (error));
- exit (1);
- }
- else
- {
- memcpy (addr, res->ai_addr, res->ai_addrlen);
- freeaddrinfo (res);
- }
- (void) freenetconfigent (nconf);
- }
- }
- else
- {
- addr->sin_family = AF_INET;
- }
-}
-
/*
* Try to obtain the address of a given host/program/version, using the
* specified protocol (one of udp or tcp).
--
1.7.12.4