Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2011-11-07 07:11:20 +0400
committerrofl0r <retnyg@gmx.net>2011-11-07 07:11:20 +0400
commit16fa60a705759be0caf8f0949f35990bd48ba155 (patch)
tree76fae1e734109827342a390daad44628bbec85d9
parent08d6feace80ef0b83bc9ce6c7d933ad00c6f0dae (diff)
oh wait. checking the hash is not enough.
-rw-r--r--src/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 423fe93..04278fb 100644
--- a/src/core.c
+++ b/src/core.c
@@ -782,9 +782,10 @@ struct hostent* proxy_gethostbyname(const char *name)
pthread_mutex_lock(&internal_ips_lock);
#endif
+ // see if we already have this dns entry saved.
if(internal_ips.counter) {
for( i = 0; i < internal_ips.counter; i++) {
- if(internal_ips.list[i]->hash == hash) {
+ if(internal_ips.list[i]->hash == hash && !strcmp(name, internal_ips.list[i]->string)) {
resolved_addr = make_internal_ip(i);
PDEBUG("got cached ip for %s\n", name);
goto have_ip;
@@ -792,6 +793,7 @@ struct hostent* proxy_gethostbyname(const char *name)
}
}
+ // grow list if needed.
if(internal_ips.capa < internal_ips.counter + 1) {
PDEBUG("realloc\n");
new_mem = realloc(internal_ips.list, (internal_ips.capa + 16) * sizeof(void*));