From f1190d2cb5331282e7b3dda7dcf08d9832d183dd Mon Sep 17 00:00:00 2001 From: Olaf Kirch Date: Mon, 20 Jan 2014 13:09:46 +0100 Subject: [PATCH 23/23] rpcinfo: remove obsolete function get_inet_address Signed-off-by: Olaf Kirch --- 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