From: Andre Noll Date: Sun, 13 Jan 2008 15:04:54 +0000 (+0100) Subject: http_send.c: Make host_in_acl() generic. X-Git-Tag: v0.3.1~95^2~7 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=d261106748ecd460edf4275df8c7e49b5e9cebaf http_send.c: Make host_in_acl() generic. Add an additional parameter for the list head that defines the acl. --- diff --git a/http_send.c b/http_send.c index ab437f4b..e140f5f2 100644 --- a/http_send.c +++ b/http_send.c @@ -214,7 +214,7 @@ static int v4_addr_match(uint32_t addr_1, uint32_t addr_2, uint8_t netmask) return (htonl(addr_1) & mask) == (htonl(addr_2) & mask); } -static int host_in_acl(int fd) +static int host_in_acl(int fd, struct list_head *acl) { struct access_info *ai, *tmp; struct sockaddr_storage ss; @@ -229,7 +229,7 @@ static int host_in_acl(int fd) if (!v4_addr.s_addr) goto no_match; - list_for_each_entry_safe(ai, tmp, &http_acl, node) + list_for_each_entry_safe(ai, tmp, acl, node) if (v4_addr_match(v4_addr.s_addr, ai->addr.s_addr, ai->netmask)) return 1; no_match: @@ -294,7 +294,7 @@ static void http_post_select(fd_set *rfds, fd_set *wfds) err_msg = "server full"; goto err_out; } - match = host_in_acl(hc->fd); + match = host_in_acl(hc->fd, &http_acl); PARA_DEBUG_LOG("host_in_acl: %d\n", match); if ((match && !conf.http_default_deny_given) || (!match && conf.http_default_deny_given)) {