return (htonl(addr_1) & mask) == (htonl(addr_2) & mask);
}
-static int host_in_access_perm_list(struct http_client *hc)
+static int host_in_acl(int fd)
{
struct access_info *ai, *tmp;
struct sockaddr_storage ss;
socklen_t sslen = sizeof(ss);
struct in_addr v4_addr;
- if (getpeername(hc->fd, (struct sockaddr *)&ss, &sslen) < 0) {
+ if (getpeername(fd, (struct sockaddr *)&ss, &sslen) < 0) {
PARA_ERROR_LOG("Can not determine peer address: %s\n", strerror(errno));
goto no_match;
}
err_msg = "server full";
goto err_out;
}
- match = host_in_access_perm_list(hc);
- PARA_DEBUG_LOG("host_in_access_perm_list: %d\n", match);
+ match = host_in_acl(hc->fd);
+ PARA_DEBUG_LOG("host_in_acl: %d\n", match);
if ((match && !conf.http_default_deny_given) ||
(!match && conf.http_default_deny_given)) {
err_msg = "permission denied";