summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert James Kaes <rjkaes@users.sourceforge.net>2002-05-31 18:08:01 +0000
committerRobert James Kaes <rjkaes@users.sourceforge.net>2002-05-31 18:08:01 +0000
commitf548ce72b241f9c2dc4dfe930f65b9ae3a844cd4 (patch)
tree0aa053f631c5e358e30bc8dec0e3860e64ac3da2
parentf3989e64cfa62cdb4f01f283896409a8ca22fedd (diff)
downloadtinyproxy-f548ce72b241f9c2dc4dfe930f65b9ae3a844cd4.tar.gz
tinyproxy-f548ce72b241f9c2dc4dfe930f65b9ae3a844cd4.zip
(getpeer_information): Fixed a problem retrieving the FQDN of a host because I was passing in an incorrect parameter to gethostbyaddr(). D'oh.
-rw-r--r--src/sock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sock.c b/src/sock.c
index 02cfa03..b2cccc3 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -1,4 +1,4 @@
-/* $Id: sock.c,v 1.37 2002-05-27 01:57:48 rjkaes Exp $
+/* $Id: sock.c,v 1.38 2002-05-31 18:08:01 rjkaes Exp $
*
* Sockets are created and destroyed here. When a new connection comes in from
* a client, we need to copy the socket and the create a second socket to the
@@ -221,10 +221,11 @@ getpeer_information(int fd, char* ipaddr, char* string_addr)
PEER_IP_LENGTH);
}
- result = gethostbyaddr(ipaddr, strlen(ipaddr), AF_INET);
+ result = gethostbyaddr((char *)&name.sin_addr.s_addr, 4, AF_INET);
if (result) {
strlcpy(string_addr, result->h_name, PEER_STRING_LENGTH);
return 0;
- } else
+ } else {
return -1;
+ }
}