Support /4 and /6 suffixes in interface names in --auth-server

This commit is contained in:
Simon Kelley
2013-11-17 12:23:42 +00:00
parent 587ad4f271
commit f25e6c6d33
3 changed files with 24 additions and 4 deletions

View File

@@ -159,7 +159,8 @@ int iface_check(int family, struct all_addr *addr, char *name, int *auth)
for (tmp = daemon->authinterface; tmp; tmp = tmp->next)
if (tmp->name)
{
if (strcmp(tmp->name, name) == 0)
if (strcmp(tmp->name, name) == 0 &&
(tmp->addr.sa.sa_family == 0 || tmp->addr.sa.sa_family == family))
break;
}
else if (addr && tmp->addr.sa.sa_family == AF_INET && family == AF_INET &&