Introduce a per connection "peer_ip" and a per request "client_ip" to

distinguish between the raw IP address of the connection and the effective
IP address of the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Graham Leggett
2011-11-25 19:42:04 +00:00
parent 984c3a345c
commit 394e5594d6
24 changed files with 74 additions and 74 deletions

View File

@ -1206,7 +1206,7 @@ static const char *conn_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
case 1:
#if APR_HAVE_IPV6
{
apr_sockaddr_t *addr = c->remote_addr;
apr_sockaddr_t *addr = c->peer_addr;
if (addr->family == AF_INET6
&& !IN6_IS_ADDR_V4MAPPED((struct in6_addr *)addr->ipaddr_ptr))
return "on";
@ -1219,7 +1219,7 @@ static const char *conn_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
case 2:
return c->log_id;
case 3:
return c->remote_ip;
return c->peer_ip;
default:
ap_assert(0);
return NULL;
@ -1342,7 +1342,7 @@ static const char *request_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
case 27:
return r->status ? apr_psprintf(ctx->p, "%d", r->status) : "";
case 28:
return r->remote_ip;
return r->client_ip;
default:
ap_assert(0);
return NULL;
@ -1491,7 +1491,7 @@ static int op_R(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg1)
if (!ctx->r)
return FALSE;
return apr_ipsubnet_test(subnet, ctx->r->remote_addr);
return apr_ipsubnet_test(subnet, ctx->r->client_addr);
}
static int op_T(ap_expr_eval_ctx_t *ctx, const void *data, const char *arg)