mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Support IPv6 subnets in parent extip
This commit is contained in:
1 parent
36f16fb899
commit
bad85a3d51
4 files changed
+30
-8
No files matched your search
+18
@@ -253,6 +253,24 @@ int handleredirect(struct clientparam * param, struct ace * acentry){
|
||||
if(cur->type == R_EXTIP){
|
||||
param->sinsl = cur->addr;
|
||||
if(SAISNULL(¶m->sinsl))param->sinsl = param->sincr;
|
||||
#ifndef NOIPV6
|
||||
else if(cur->cidr && *SAFAMILY(¶m->sinsl) == AF_INET6){
|
||||
char c;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < 16; i++){
|
||||
if(i%8)myrand(¶m->sincr, sizeof(param->sincr));
|
||||
else if(i%4) myrand(¶m->req, sizeof(param->req));
|
||||
|
||||
if(i*8 >= cur->cidr) ((char *)SAADDR(¶m->sinsl))[i] = rand();
|
||||
else if ((i+1)*8 > cur->cidr){
|
||||
c = rand();
|
||||
c >>= (cur->cidr - (i*8));
|
||||
((char *)SAADDR(¶m->sinsl))[i] |= c;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(cur->next)continue;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user