Do not resolve hostname to IP on ACL destination

This commit is contained in:
z3APA3A 2020-08-06 17:57:50 +03:00
parent 8c511a19e9
commit c30b4637a5

View File

@ -777,13 +777,16 @@ int scanipl(unsigned char *arg, struct iplist *dst){
#endif
char * slash, *dash;
int masklen, addrlen;
if((slash = strchr((char *)arg, '/'))) *slash = 0;
if((dash = strchr((char *)arg,'-'))) *dash = 0;
if(afdetect(arg) == -1) return 1;
if(!getip46(46, arg, (struct sockaddr *)&sa)) return 1;
memcpy(&dst->ip_from, SAADDR(&sa), SAADDRLEN(&sa));
dst->family = *SAFAMILY(&sa);
if(dash){
if(afdetect(dash+1) == -1) return 1;
if(!getip46(46, (unsigned char *)dash+1, (struct sockaddr *)&sa)) return 2;
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;