diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-08-07 03:08:40 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-08-07 03:08:40 +0000 |
commit | 1d3e5fc8a29bb490ff950b8da6d339318004552f (patch) | |
tree | 8c5b97214c6215881d32334113c8955ed5eb97e5 /isys | |
parent | 96a887806e6be360ffa21c0059162e7b6a193ab0 (diff) | |
download | anaconda-1d3e5fc8a29bb490ff950b8da6d339318004552f.tar.gz anaconda-1d3e5fc8a29bb490ff950b8da6d339318004552f.tar.xz anaconda-1d3e5fc8a29bb490ff950b8da6d339318004552f.zip |
how this worked when it was in the loader standalone, I'm not quite sure, but this works
Diffstat (limited to 'isys')
-rw-r--r-- | isys/dns.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/isys/dns.c b/isys/dns.c index 776441d8d..e67c4186f 100644 --- a/isys/dns.c +++ b/isys/dns.c @@ -121,7 +121,8 @@ int mygethostbyname(char * name, struct in_addr * addr) { #else #include <netdb.h> - +#include <sys/socket.h> +#include <string.h> int mygethostbyname(char * host, struct in_addr * address) { struct hostent * hostinfo; @@ -133,11 +134,15 @@ int mygethostbyname(char * host, struct in_addr * address) { return 0; } -char * mygethostbyaddr(char * ipnum) { +char * mygethostbyaddr(const char * ipnum) { struct hostent * he; + struct in_addr * addr; - he = gethostbyaddr( ipnum, strlen(ipnum), AF_INET); - if (he) + if (!inet_aton(ipnum, addr)) + return NULL; + + he = gethostbyaddr(addr, sizeof(struct in_addr), AF_INET); + if (he) return he->h_name; else return NULL; |