FreeBSD Bugzilla – Attachment 134801 Details for
Bug 179527
[Patch] Fix for www/mod_rpaf2 compatibility with Apache 2.4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.73 KB, created by
morfin60
on 2013-06-12 23:50:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
morfin60
Created:
2013-06-12 23:50:02 UTC
Size:
2.73 KB
patch
obsolete
>--- /usr/ports/www/mod_rpaf2/work/mod_rpaf-0.6/mod_rpaf-2.0.c 2008-01-01 08:05:40.000000000 +0500 >+++ mod_rpaf-2.0.c 2013-06-13 03:41:46.000000000 +0600 >@@ -86,6 +86,23 @@ > request_rec *r; > } rpaf_cleanup_rec; > >+inline apr_sockaddr_t * client_addr(conn_rec *c) { >+#if AP_SERVER_MAJORVERSION_NUMBER >= 2 && AP_SERVER_MINORVERSION_NUMBER >= 4 >+ return c->client_addr; >+#else >+ return c->remote_addr; >+#endif >+} >+ >+inline char * client_ip(conn_rec *c) { >+#if AP_SERVER_MAJORVERSION_NUMBER >= 2 && AP_SERVER_MINORVERSION_NUMBER >= 4 >+ return c->client_ip; >+#else >+ return c->remote_ip; >+#endif >+} >+ >+ > static void *rpaf_create_server_cfg(apr_pool_t *p, server_rec *s) { > rpaf_server_cfg *cfg = (rpaf_server_cfg *)apr_pcalloc(p, sizeof(rpaf_server_cfg)); > if (!cfg) >@@ -147,8 +164,9 @@ > > static apr_status_t rpaf_cleanup(void *data) { > rpaf_cleanup_rec *rcr = (rpaf_cleanup_rec *)data; >- rcr->r->connection->remote_ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip); >- rcr->r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(rcr->r->connection->remote_ip); >+ char *ip = client_ip(rcr->r->connection); >+ ip = apr_pstrdup(rcr->r->connection->pool, rcr->old_ip); >+ client_addr(rcr->r->connection)->sa.sin.sin_addr.s_addr = apr_inet_addr(ip); > return APR_SUCCESS; > } > >@@ -161,7 +179,7 @@ > if (!cfg->enable) > return DECLINED; > >- if (is_in_array(r->connection->remote_ip, cfg->proxy_ips) == 1) { >+ if (is_in_array(client_ip(r->connection), cfg->proxy_ips) == 1) { > /* check if cfg->headername is set and if it is use > that instead of X-Forwarded-For by default */ > if (cfg->headername && (fwdvalue = apr_table_get(r->headers_in, cfg->headername))) { >@@ -180,11 +198,12 @@ > if (*fwdvalue != '\0') > ++fwdvalue; > } >- rcr->old_ip = apr_pstrdup(r->connection->pool, r->connection->remote_ip); >+ rcr->old_ip = apr_pstrdup(r->connection->pool, client_ip(r->connection)); > rcr->r = r; > apr_pool_cleanup_register(r->pool, (void *)rcr, rpaf_cleanup, apr_pool_cleanup_null); >- r->connection->remote_ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]); >- r->connection->remote_addr->sa.sin.sin_addr.s_addr = apr_inet_addr(r->connection->remote_ip); >+ char *ip = client_ip(r->connection); >+ ip = apr_pstrdup(r->connection->pool, ((char **)arr->elts)[((arr->nelts)-1)]); >+ client_addr(r->connection)->sa.sin.sin_addr.s_addr = apr_inet_addr(client_ip(r->connection)); > if (cfg->sethostname) { > const char *hostvalue; > if (hostvalue = apr_table_get(r->headers_in, "X-Forwarded-Host")) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 179527
: 134801