mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 10:35:40 +08:00
Do not resolve hostname to IP on ACL destination
This commit is contained in:
parent
8c511a19e9
commit
c30b4637a5
@ -777,13 +777,16 @@ int scanipl(unsigned char *arg, struct iplist *dst){
|
|||||||
#endif
|
#endif
|
||||||
char * slash, *dash;
|
char * slash, *dash;
|
||||||
int masklen, addrlen;
|
int masklen, addrlen;
|
||||||
|
|
||||||
if((slash = strchr((char *)arg, '/'))) *slash = 0;
|
if((slash = strchr((char *)arg, '/'))) *slash = 0;
|
||||||
if((dash = strchr((char *)arg,'-'))) *dash = 0;
|
if((dash = strchr((char *)arg,'-'))) *dash = 0;
|
||||||
|
|
||||||
|
if(afdetect(arg) == -1) return 1;
|
||||||
if(!getip46(46, arg, (struct sockaddr *)&sa)) return 1;
|
if(!getip46(46, arg, (struct sockaddr *)&sa)) return 1;
|
||||||
memcpy(&dst->ip_from, SAADDR(&sa), SAADDRLEN(&sa));
|
memcpy(&dst->ip_from, SAADDR(&sa), SAADDRLEN(&sa));
|
||||||
dst->family = *SAFAMILY(&sa);
|
dst->family = *SAFAMILY(&sa);
|
||||||
if(dash){
|
if(dash){
|
||||||
|
if(afdetect(dash+1) == -1) return 1;
|
||||||
if(!getip46(46, (unsigned char *)dash+1, (struct sockaddr *)&sa)) return 2;
|
if(!getip46(46, (unsigned char *)dash+1, (struct sockaddr *)&sa)) return 2;
|
||||||
memcpy(&dst->ip_to, SAADDR(&sa), SAADDRLEN(&sa));
|
memcpy(&dst->ip_to, SAADDR(&sa), SAADDRLEN(&sa));
|
||||||
if(*SAFAMILY(&sa) != dst->family || memcmp(&dst->ip_to, &dst->ip_from, SAADDRLEN(&sa)) < 0) return 3;
|
if(*SAFAMILY(&sa) != dst->family || memcmp(&dst->ip_to, &dst->ip_from, SAADDRLEN(&sa)) < 0) return 3;
|
||||||
|
Loading…
Reference in New Issue
Block a user