diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-07-29 21:54:39 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-07-29 21:54:39 +0000 |
commit | 698647c8b8650ca7132e8dbc457117510ffbd4ec (patch) | |
tree | bb936977b6c676dc66b0b0b72ad8bff0ff1c14d2 /isys/dns.c | |
parent | f1b45c3ec8588cdcd08e76291a96842641ca824b (diff) | |
download | anaconda-698647c8b8650ca7132e8dbc457117510ffbd4ec.tar.gz anaconda-698647c8b8650ca7132e8dbc457117510ffbd4ec.tar.xz anaconda-698647c8b8650ca7132e8dbc457117510ffbd4ec.zip |
merge ia64 branch bits to have dns work in non-diet loaders
Diffstat (limited to 'isys/dns.c')
-rw-r--r-- | isys/dns.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/isys/dns.c b/isys/dns.c index 232215efa..776441d8d 100644 --- a/isys/dns.c +++ b/isys/dns.c @@ -9,6 +9,7 @@ /* This is dumb, but glibc doesn't like to do hostname lookups w/o libc.so */ +#ifndef DIET union dns_response{ HEADER hdr; u_char buf[PACKETSZ]; @@ -117,3 +118,29 @@ char * mygethostbyaddr(char * ipnum) { int mygethostbyname(char * name, struct in_addr * addr) { return doQuery(name, T_A, NULL, addr); } + +#else +#include <netdb.h> + + +int mygethostbyname(char * host, struct in_addr * address) { + struct hostent * hostinfo; + + hostinfo = gethostbyname(host); + if (!hostinfo) return 1; + + memcpy(address, hostinfo->h_addr_list[0], hostinfo->h_length); + return 0; +} + +char * mygethostbyaddr(char * ipnum) { + struct hostent * he; + + he = gethostbyaddr( ipnum, strlen(ipnum), AF_INET); + if (he) + return he->h_name; + else + return NULL; +} + +#endif |