mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
IPv6 server side code
+ IPv6 server side support !!! Auth need to be fixed
This commit is contained in:
1 parent
ccf606fd9e
commit
a30d5d51a5
15 files changed
+141
-122
No files matched your search
+4
-4
@@ -22,7 +22,7 @@ int randomizer = 1;
|
||||
|
||||
unsigned char **stringtable = NULL;
|
||||
|
||||
int myinet_ntop(int af, const void *src, char *dst, socklen_t size){
|
||||
int myinet_ntop(int af, void *src, char *dst, socklen_t size){
|
||||
#ifndef NOIPV6
|
||||
if(af != AF_INET6){
|
||||
#endif
|
||||
@@ -463,7 +463,7 @@ int dobuf2(struct clientparam * param, unsigned char * buf, const unsigned char
|
||||
i += myinet_ntop(AF_INET, &tmpia, (char *)buf + i, 64);
|
||||
break;
|
||||
case 'C':
|
||||
i += myinet_ntop(*SAFAMILY(¶m->sinc), SAADDR(¶m->sinc), (char *)buf + i, 64);
|
||||
i += myinet_ntop(*SAFAMILY(¶m->sincr), SAADDR(¶m->sincr), (char *)buf + i, 64);
|
||||
break;
|
||||
case 'R':
|
||||
i += myinet_ntop(*SAFAMILY(¶m->sins), SAADDR(¶m->sins), (char *)buf + i, 64);
|
||||
@@ -476,7 +476,7 @@ int dobuf2(struct clientparam * param, unsigned char * buf, const unsigned char
|
||||
i += (int)strlen((char *)buf+i);
|
||||
break;
|
||||
case 'c':
|
||||
sprintf((char *)buf+i, "%hu", ntohs(param->sinc.sin_port));
|
||||
sprintf((char *)buf+i, "%hu", ntohs(*SAPORT(¶m->sincr)));
|
||||
i += (int)strlen((char *)buf+i);
|
||||
break;
|
||||
case 'r':
|
||||
@@ -612,7 +612,7 @@ int doconnect(struct clientparam * param){
|
||||
bindsa.sin_family = AF_INET;
|
||||
bindsa.sin_port = param->extport;
|
||||
bindsa.sin_addr.s_addr = param->extip;
|
||||
if (param->srv->targetport && !bindsa.sin_port && ntohs(param->sinc.sin_port) > 1023) bindsa.sin_port = param->sinc.sin_port;
|
||||
if (param->srv->targetport && !bindsa.sin_port && ntohs(*SAPORT(¶m->sincr)) > 1023) bindsa.sin_port = *SAPORT(¶m->sincr);
|
||||
if(so._bind(param->remsock, (struct sockaddr*)&bindsa, sizeof(bindsa))==-1) {
|
||||
memset(&bindsa, 0, sizeof(bindsa));
|
||||
bindsa.sin_family = AF_INET;
|
||||
|
||||
Reference in new issue
Block a user