y-ken/mod_rpaf — pull request #2 by vivanv (2013-09-11 12:40:29+00:00)
Title: I’ve fixed an issue of the mod_authz_host's Allow/Deny directives  worki...

...ng incorrectly on httpd 2.2.25.

The apr_ipsubnet_test function was changed in APR 1.4.7, as well as in 1.4.8 that is included in httpd 2.2.25
apr_ipsubnet_test function looks like this right now:
APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
{
#if APR_HAVE_IPV6
/* XXX This line will segv on Win32 build with APR_HAVE_IPV6,
* but without the IPV6 drivers installed.
*/
if (sa->family == AF_INET) {
if (ipsub->family == AF_INET &&
((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) {
return 1;
}
...
the previous version:
APR_DECLARE(int) apr_ipsubnet_test(apr_ipsubnet_t *ipsub, apr_sockaddr_t *sa)
{
#if APR_HAVE_IPV6
/* XXX This line will segv on Win32 build with APR_HAVE_IPV6,
* but without the IPV6 drivers installed.
*/
if (sa->sa.sin.sin_family == AF_INET) {
if (ipsub->family == AF_INET &&
((sa->sa.sin.sin_addr.s_addr & ipsub->mask[0]) == ipsub->sub[0])) {
return 1;
}

So IPv4 IP addresses do not match in Allow and Deny directives of mod_authz_host module.
My modifications resolve this issue.