mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-06 21:02:55 +08:00
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
This commit is contained in:
parent
452830283c
commit
59e8d1710a
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user