mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-23 01:12:59 +08:00
oh wait. checking the hash is not enough.
This commit is contained in:
parent
08d6feace8
commit
16fa60a705
@ -782,9 +782,10 @@ struct hostent* proxy_gethostbyname(const char *name)
|
|||||||
pthread_mutex_lock(&internal_ips_lock);
|
pthread_mutex_lock(&internal_ips_lock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// see if we already have this dns entry saved.
|
||||||
if(internal_ips.counter) {
|
if(internal_ips.counter) {
|
||||||
for( i = 0; i < internal_ips.counter; i++) {
|
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);
|
resolved_addr = make_internal_ip(i);
|
||||||
PDEBUG("got cached ip for %s\n", name);
|
PDEBUG("got cached ip for %s\n", name);
|
||||||
goto have_ip;
|
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) {
|
if(internal_ips.capa < internal_ips.counter + 1) {
|
||||||
PDEBUG("realloc\n");
|
PDEBUG("realloc\n");
|
||||||
new_mem = realloc(internal_ips.list, (internal_ips.capa + 16) * sizeof(void*));
|
new_mem = realloc(internal_ips.list, (internal_ips.capa + 16) * sizeof(void*));
|
||||||
|
Loading…
Reference in New Issue
Block a user