diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-11-10 11:22:46 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-11-10 11:22:46 +0000 |
commit | cd8c436d811a5a077a0b61a6616c900173e2dcfb (patch) | |
tree | 94163bfef63fec4c2638d5f56be310b7176464d7 /networking/nslookup.c | |
parent | 94f19a838518293810a0fc0c4dca926ca8caff57 (diff) | |
download | busybox-w32-cd8c436d811a5a077a0b61a6616c900173e2dcfb.tar.gz busybox-w32-cd8c436d811a5a077a0b61a6616c900173e2dcfb.tar.bz2 busybox-w32-cd8c436d811a5a077a0b61a6616c900173e2dcfb.zip |
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.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/networking/nslookup.c b/networking/nslookup.c index a1a12d992..81b57cccf 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -90,10 +90,10 @@ static int addr_list_fprint(char **h_addr_list) | |||
90 | } | 90 | } |
91 | 91 | ||
92 | /* print the results as nslookup would */ | 92 | /* print the results as nslookup would */ |
93 | static struct hostent *hostent_fprint(struct hostent *host) | 93 | static struct hostent *hostent_fprint(struct hostent *host, const char *server_host) |
94 | { | 94 | { |
95 | if (host) { | 95 | if (host) { |
96 | printf("Name: %s\n", host->h_name); | 96 | printf("%s %s\n", server_host, host->h_name); |
97 | addr_list_fprint(host->h_addr_list); | 97 | addr_list_fprint(host->h_addr_list); |
98 | } else { | 98 | } else { |
99 | printf("*** Unknown host\n"); | 99 | printf("*** Unknown host\n"); |
@@ -142,7 +142,7 @@ static inline void server_print(void) | |||
142 | struct sockaddr_in def = _res.nsaddr_list[0]; | 142 | struct sockaddr_in def = _res.nsaddr_list[0]; |
143 | char *ip = inet_ntoa(def.sin_addr); | 143 | char *ip = inet_ntoa(def.sin_addr); |
144 | 144 | ||
145 | hostent_fprint(gethostbyaddr_wrapper(ip)); | 145 | hostent_fprint(gethostbyaddr_wrapper(ip), "Server:"); |
146 | printf("\n"); | 146 | printf("\n"); |
147 | } | 147 | } |
148 | #endif | 148 | #endif |
@@ -176,8 +176,8 @@ int nslookup_main(int argc, char **argv) | |||
176 | } else { | 176 | } else { |
177 | host = xgethostbyname(argv[1]); | 177 | host = xgethostbyname(argv[1]); |
178 | } | 178 | } |
179 | hostent_fprint(host); | 179 | hostent_fprint(host, "Name: "); |
180 | return EXIT_SUCCESS; | 180 | return EXIT_SUCCESS; |
181 | } | 181 | } |
182 | 182 | ||
183 | /* $Id: nslookup.c,v 1.26 2001/10/24 04:59:56 andersen Exp $ */ | 183 | /* $Id: nslookup.c,v 1.27 2001/11/10 11:22:43 andersen Exp $ */ |