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 <rofl0r@users.noreply.github.com>2020-10-28 13:46:23 +0300
committerrofl0r <rofl0r@users.noreply.github.com>2020-10-28 14:12:17 +0300
commit59e8d1710a8f03a95513557b3feef20db2a2bd34 (patch)
treee0dc2a29129b1bd1bdb67c7ca24286620f73869a
parent452830283c081ac9a677a3e823d28575295626d9 (diff)
proxy_gethostbyname(): fix failure to omit DNS lookup for ipv4 addrs
gethostbyname() is specified to transform simple numeric ipv4 addresses into their binary form. since proxy_gethostbyname() was used as a backend for all resolver functions, somehow we assumed the check for an ipv4 was done from another site, however this didn't hold true when the caller used gethostbyname() directly. fixes #347
-rw-r--r--src/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 4226a7e..59d07de 100644
--- a/src/core.c
+++ b/src/core.c
@@ -849,6 +849,11 @@ struct hostent *proxy_gethostbyname(const char *name, struct gethostbyname_data*
data->hostent_space.h_addrtype = AF_INET;
data->hostent_space.h_length = sizeof(in_addr_t);
+ if(pc_isnumericipv4(name)) {
+ data->resolved_addr = inet_addr(name);
+ goto retname;
+ }
+
gethostname(buff, sizeof(buff));
if(!strcmp(buff, name)) {