File apache24.patch of Package apache2-mod_rpaf
x
1
--- mod_rpaf-0.6/mod_rpaf-2.0.c.orig 2013-07-28 11:12:54.858051897 +0200
2
+++ mod_rpaf-0.6/mod_rpaf-2.0.c 2013-07-28 11:15:08.621436640 +0200
3
4
5
static apr_status_t rpaf_cleanup(void *data) {
6
rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)data;
7
- rcr->r->connection->remote_ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip);
8
- rcr->r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->remote_ip);
9
+ rcr->r->connection->client_ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip);
10
+ rcr->r->connection->client_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->client_ip);
11
return APR_SUCCESS;
12
}
13
14
15
if (!cfg->enable)
16
return DECLINED;
17
18
- if (is_in_array(r->connection->remote_ip, cfg->proxy_ips) == 1) {
19
+ if (is_in_array(r->connection->client_ip, cfg->proxy_ips) == 1) {
20
/* check if cfg->headername is set and if it is use
21
that instead of X-Forwarded-For by default */
22
if (cfg->headername && (fwdvalue = apr_table_get(r->headers_in, cfg->headername))) {
23
24
if (*fwdvalue != '\0')
25
++fwdvalue;
26
}
27
- rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->remote_ip);
28
+ rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->client_ip);
29
rcr->r = r;
30
apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null);
31
- r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]);
32
- r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip);
33
+ r->connection->client_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]);
34
+ r->connection->client_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->client_ip);
35
if (cfg->sethostname) {
36
const char *hostvalue;
37
if (hostvalue = apr_table_get(r->headers_in, "X-Forwarded-Host")) {
38