Support IPv6 for parent proxy

Parent proxy can be on IPv6 network (except SOCKS4).
This commit is contained in:
z3APA3A committed 2014-12-13 22:38:03 +03:00
1 parent d2437975b7
commit 8a6632f0d1
7 files changed
+58 -54

No files matched your search

+7 -3
View File
@@ -36,7 +36,7 @@ int myinet_ntop(int af, void *src, char *dst, socklen_t size){
}
*dst = 0;
inet_ntop(af, src, dst, size);
return strlen(dst);
return (int)strlen(dst);
#endif
}
@@ -90,6 +90,8 @@ struct extparam conf = {
int numservers=0;
char* NULLADDR="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
int myrand(void * entropy, int len){
int i;
unsigned short init;
@@ -613,8 +615,10 @@ int doconnect(struct clientparam * param){
else {
struct linger lg;
if(!memcmp(SAADDR(&param->sinsr), "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", SAADDRLEN(&param->sinsr))){
if(!memcmp(SAADDR(&param->req), "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", SAADDRLEN(&param->req))) return 100;
if(SAISNULL(&param->sinsr)){
if(SAISNULL(&param->req)) {
return 100;
}
*SAFAMILY(&param->sinsr) = *SAFAMILY(&param->req);
memcpy(SAADDR(&param->sinsr), SAADDR(&param->req), SAADDRLEN(&param->req));
}