diff options
author | Yann Ylavic <ylavic@apache.org> | 2015-09-18 18:43:25 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2015-09-18 18:43:25 +0200 |
commit | fab37e8e26c13e26f7e7f3173adf1d09159b0a8a (patch) | |
tree | 7c6b2d8e54fb5ef8873ec56a360b4ffc6236de68 /modules/proxy/proxy_util.c | |
parent | mod_ssl: update the current handshake server once a full regenegotation (diff) | |
download | apache2-fab37e8e26c13e26f7e7f3173adf1d09159b0a8a.tar.xz apache2-fab37e8e26c13e26f7e7f3173adf1d09159b0a8a.zip |
mod_proxy: Fix ProxySourceAddress binding failure with AH00938. PR 56687.
Proposed by: Arne de Bruijn <apache arbruijn.dds.nl>
Reviewed by: ylavic
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1703902 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/proxy/proxy_util.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 1aebd2467a..4f5db685e8 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -2148,7 +2148,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", |