mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Support IPv6 for parent proxy
Parent proxy can be on IPv6 network (except SOCKS4).
This commit is contained in:
1 parent
d2437975b7
commit
8a6632f0d1
7 files changed
+58
-54
No files matched your search
+7
-3
@@ -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(¶m->sinsr), "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", SAADDRLEN(¶m->sinsr))){
|
||||
if(!memcmp(SAADDR(¶m->req), "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", SAADDRLEN(¶m->req))) return 100;
|
||||
if(SAISNULL(¶m->sinsr)){
|
||||
if(SAISNULL(¶m->req)) {
|
||||
return 100;
|
||||
}
|
||||
*SAFAMILY(¶m->sinsr) = *SAFAMILY(¶m->req);
|
||||
memcpy(SAADDR(¶m->sinsr), SAADDR(¶m->req), SAADDRLEN(¶m->req));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user