mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2024-10-31 17:18:47 +00:00
fix case where proxy was using a DNS name or non-dotted ipv4
it is generally invalid to use a DNS name since DNS subsystem is only available once connected to the proxy; because DNS is done server-side. closes #19
This commit is contained in:
parent
9f6ed6ed90
commit
64a7cd26dc
@ -192,7 +192,12 @@ static void get_chain_data(proxy_data * pd, unsigned int *proxy_count, chain_typ
|
||||
|
||||
sscanf(buff, "%s %s %d %s %s", type, host, &port_n, pd[count].user, pd[count].pass);
|
||||
|
||||
pd[count].ip.as_int = (uint32_t) inet_addr(host);
|
||||
in_addr_t host_ip = inet_addr(host);
|
||||
if(host_ip == INADDR_NONE) {
|
||||
fprintf(stderr, "proxy %s has invalid value or is not numeric\n", host);
|
||||
exit(1);
|
||||
}
|
||||
pd[count].ip.as_int = (uint32_t) host_ip;
|
||||
pd[count].port = htons((unsigned short) port_n);
|
||||
|
||||
if(!strcmp(type, "http")) {
|
||||
|
Loading…
Reference in New Issue
Block a user