]> granicus.if.org Git - apache/commitdiff
Merge r1703902 from trunk:
authorJim Jagielski <jim@apache.org>
Wed, 30 Sep 2015 13:31:29 +0000 (13:31 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 30 Sep 2015 13:31:29 +0000 (13:31 +0000)
mod_proxy: Fix ProxySourceAddress binding failure with AH00938.  PR 56687.
Proposed by: Arne de Bruijn <apache arbruijn.dds.nl>
Reviewed by: ylavic

Submitted by: ylavic
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1706028 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/proxy_util.c

diff --git a/CHANGES b/CHANGES
index b31b1af66f445525bd9927d5accef99a4aef660e..288b4659120e4fd2d1c1f8542cedfc942a7e34a7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.17
 
+  *) mod_proxy: Fix ProxySourceAddress binding failure with AH00938.
+     PR 56687.  [Arne de Bruijn <apache arbruijn.dds.nl>
+
   *) mod_ssl: Support compilation against libssl built with OPENSSL_NO_SSL3,
      and change the compiled-in default for SSL[Proxy]Protocol to "all -SSLv3",
      in accordance with RFC 7568. PR 58349, PR 57120. [Kaspar Brand]
@@ -17,7 +20,7 @@ Changes with Apache 2.4.17
      variables. Addresses PR 58020. [Jan Pazdziora <jpazdziora redhat.com>,
      Kaspar Brand]
 
-  *) mod_h2: added donated http/2 implementation to build system. Similar
+  *) mod_http2: added donated http/2 implementation to build system. Similar
      configuration options to mod_ssl. [Stefan Eissing]
 
   *) mod_logio: Fix logging of %^FB (time to first byte) on the first request on
index 4163e9e54c217a284d23e533d35cf7178c47cfbf..dbe8a2935844620f38d3c23b3290b716ab5c3753 100644 (file)
@@ -2076,7 +2076,14 @@ PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock,
                       proxy_function, backend_addr->family, backend_name);
 
         if (conf->source_address) {
-            rv = apr_socket_bind(*newsock, conf->source_address);
+            apr_sockaddr_t *local_addr;
+            /* Make a copy since apr_socket_bind() could change
+             * conf->source_address, which we don't want.
+             */
+            local_addr = apr_pmemdup(r->pool, conf->source_address,
+                                     sizeof(apr_sockaddr_t));
+            local_addr->pool = r->pool;
+            rv = apr_socket_bind(*newsock, local_addr);
             if (rv != APR_SUCCESS) {
                 ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(00938)
                               "%s: failed to bind socket to local address",