diff options
Diffstat (limited to 'crypto/heimdal/lib/roken/roken_gethostby.c')
-rw-r--r-- | crypto/heimdal/lib/roken/roken_gethostby.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/heimdal/lib/roken/roken_gethostby.c b/crypto/heimdal/lib/roken/roken_gethostby.c index 6df6c57..ff0af86 100644 --- a/crypto/heimdal/lib/roken/roken_gethostby.c +++ b/crypto/heimdal/lib/roken/roken_gethostby.c @@ -33,10 +33,10 @@ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$Id: roken_gethostby.c,v 1.5 1999/12/05 13:16:44 assar Exp $"); +RCSID("$Id: roken_gethostby.c 21157 2007-06-18 22:03:13Z lha $"); #endif -#include <roken.h> +#include "roken.h" #undef roken_gethostbyname #undef roken_gethostbyaddr @@ -107,11 +107,11 @@ split_spec(const char *spec, char **host, int *port, char **path, int def_port) } -int +int ROKEN_LIB_FUNCTION roken_gethostby_setup(const char *proxy_spec, const char *dns_spec) { char *proxy_host = NULL; - int proxy_port; + int proxy_port = 0; char *dns_host, *dns_path; int dns_port; @@ -137,7 +137,7 @@ static struct hostent* roken_gethostby(const char *hostname) { int s; - struct sockaddr_in sin; + struct sockaddr_in addr; char *request; char buf[1024]; int offset = 0; @@ -146,7 +146,7 @@ roken_gethostby(const char *hostname) if(dns_addr.sin_family == 0) return NULL; /* no configured host */ - sin = dns_addr; + addr = dns_addr; asprintf(&request, "GET %s?%s HTTP/1.0\r\n\r\n", dns_req, hostname); if(request == NULL) return NULL; @@ -155,7 +155,7 @@ roken_gethostby(const char *hostname) free(request); return NULL; } - if(connect(s, (struct sockaddr*)&sin, sizeof(sin)) < 0) { + if(connect(s, (struct sockaddr*)&addr, sizeof(addr)) < 0) { close(s); free(request); return NULL; @@ -186,7 +186,7 @@ roken_gethostby(const char *hostname) #define MAX_ADDRS 16 static struct hostent he; static char addrs[4 * MAX_ADDRS]; - static char *addr_list[MAX_ADDRS]; + static char *addr_list[MAX_ADDRS + 1]; int num_addrs = 0; he.h_name = p; @@ -220,7 +220,7 @@ roken_gethostbyname(const char *hostname) return roken_gethostby(hostname); } -struct hostent* +struct hostent* ROKEN_LIB_FUNCTION roken_gethostbyaddr(const void *addr, size_t len, int type) { struct in_addr a; |