mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 02:25:40 +08:00
Allow hostnames in parent
This commit is contained in:
parent
782878b5b4
commit
13979b5df4
@ -609,7 +609,7 @@ unsigned long getip46(int family, unsigned char *name, struct sockaddr *sa){
|
|||||||
if(detect != -1){
|
if(detect != -1){
|
||||||
if(family == 4 && detect != AF_INET) return 0;
|
if(family == 4 && detect != AF_INET) return 0;
|
||||||
*SAFAMILY(sa) = (family == 6)? AF_INET6 : detect;
|
*SAFAMILY(sa) = (family == 6)? AF_INET6 : detect;
|
||||||
return inet_pton(*SAFAMILY(sa), (char *)name, SAADDR(sa))? *SAFAMILY(sa) : 0;
|
return inet_pton(*SAFAMILY(sa), (char *)name, SAADDR(sa))>0? *SAFAMILY(sa) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -766,7 +766,7 @@ static int h_parent(int argc, unsigned char **argv){
|
|||||||
}
|
}
|
||||||
cidr = strchr(argv[3], '/');
|
cidr = strchr(argv[3], '/');
|
||||||
if(cidr) *cidr = 0;
|
if(cidr) *cidr = 0;
|
||||||
getip46(46, argv[3], (struct sockaddr *)&chains->addr);
|
if(!getip46(46, argv[3], (struct sockaddr *)&chains->addr)) return (5);
|
||||||
chains->exthost = (unsigned char *)mystrdup((char *)argv[3]);
|
chains->exthost = (unsigned char *)mystrdup((char *)argv[3]);
|
||||||
if(!chains->exthost) return 21;
|
if(!chains->exthost) return 21;
|
||||||
if(cidr){
|
if(cidr){
|
||||||
|
Loading…
Reference in New Issue
Block a user