mirror of
https://github.com/rofl0r/proxychains-ng.git
synced 2025-09-10 13:07:35 +00:00
preliminary ipv6 support
only basic testing was done (with 2 socks5 proxies listening on ::1) but seems to work as intended. ipv6 support for the hostsreader (/etc/hosts) is not implemented so far.
This commit is contained in:
@ -73,16 +73,16 @@ char* hostsreader_get_ip_for_name(const char* name, char* buf, size_t bufsize) {
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
ip_type hostsreader_get_numeric_ip_for_name(const char* name) {
|
||||
ip_type4 hostsreader_get_numeric_ip_for_name(const char* name) {
|
||||
char *hres;
|
||||
char buf[320];
|
||||
if((hres = hostsreader_get_ip_for_name(name, buf, sizeof buf))) {
|
||||
struct in_addr c;
|
||||
inet_aton(hres, &c);
|
||||
ip_type res;
|
||||
ip_type4 res;
|
||||
memcpy(res.octet, &c.s_addr, 4);
|
||||
return res;
|
||||
} else return ip_type_invalid;
|
||||
} else return ip_type_invalid.addr.v4;
|
||||
}
|
||||
|
||||
#ifdef HOSTSREADER_TEST
|
||||
|
Reference in New Issue
Block a user