summaryrefslogtreecommitdiff
path: root/networking/nslookup.c
diff options
context:
space:
mode:
authorEric Andersen2001-11-10 11:22:46 +0000
committerEric Andersen2001-11-10 11:22:46 +0000
commitcd8c436d811a5a077a0b61a6616c900173e2dcfb (patch)
tree94163bfef63fec4c2638d5f56be310b7176464d7 /networking/nslookup.c
parent94f19a838518293810a0fc0c4dca926ca8caff57 (diff)
downloadbusybox-cd8c436d811a5a077a0b61a6616c900173e2dcfb.zip
busybox-cd8c436d811a5a077a0b61a6616c900173e2dcfb.tar.gz
Latest patch from vodz:
-- reverse resolve network name and cache in route and ifconfig applets, fix print nslookup server name if compile without uClibc, fix route crashe 'route add', fix warnings compile networking and pwd_grp applets
Diffstat (limited to 'networking/nslookup.c')
-rw-r--r--networking/nslookup.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/networking/nslookup.c b/networking/nslookup.c
index a1a12d9..81b57cc 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -90,10 +90,10 @@ static int addr_list_fprint(char **h_addr_list)
}
/* print the results as nslookup would */
-static struct hostent *hostent_fprint(struct hostent *host)
+static struct hostent *hostent_fprint(struct hostent *host, const char *server_host)
{
if (host) {
- printf("Name: %s\n", host->h_name);
+ printf("%s %s\n", server_host, host->h_name);
addr_list_fprint(host->h_addr_list);
} else {
printf("*** Unknown host\n");
@@ -142,7 +142,7 @@ static inline void server_print(void)
struct sockaddr_in def = _res.nsaddr_list[0];
char *ip = inet_ntoa(def.sin_addr);
- hostent_fprint(gethostbyaddr_wrapper(ip));
+ hostent_fprint(gethostbyaddr_wrapper(ip), "Server:");
printf("\n");
}
#endif
@@ -176,8 +176,8 @@ int nslookup_main(int argc, char **argv)
} else {
host = xgethostbyname(argv[1]);
}
- hostent_fprint(host);
+ hostent_fprint(host, "Name: ");
return EXIT_SUCCESS;
}
-/* $Id: nslookup.c,v 1.26 2001/10/24 04:59:56 andersen Exp $ */
+/* $Id: nslookup.c,v 1.27 2001/11/10 11:22:43 andersen Exp $ */