httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44806] Set the IP address+port used for backend proxy requests.
Date Tue, 03 Jun 2008 08:04:31 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44806





--- Comment #17 from D. Stussy <apache+bugreports@kd6lvw.ampr.org>  2008-06-03 01:04:31
PST ---
RE:  Comment #15 - patch:

Code in modules/proxy/proxy_util.c      (working copy)
@@ -2349,6 +2373,21 @@

Does NOT cycle through all the addresses.  It tries the first address of the
matching address family in the list, and if that fails, it fails the whole
attempt.  It does not try other addresses in the same address family (e.g.
multi-homed host, virtual hosts, etc.).  One address may work where another one
fails due to interface, firewall, or routing table considerations.

Try this:
@@ -2349,6 +2373,19 @@
                      "proxy: %s: fam %d socket created to connect to %s",
                      proxy_function, backend_addr->family, worker->hostname);

+        if (conf->bindopt_set) {
+            for(apr_sockaddr_t *addr = conf->bind_addr; addr; addr =
addr->next) {
+                if (addr->family != backend_addr->family) continue;
+                if (bind_to_addr(newsock, laddr, proxy_function, conf, s) ==
APR_SUCCESS)
+                    break;
+                ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, "proxy: %s: can not
bind to %s:%u+%u",
+                        proxy_function,conf->bind_addr, conf->bind_port,
conf->bind_range, NULL);
+            }
+            if (!addr)
+                return DECLINED;
+            }
+        }
+
         /* make the connection out of the socket */
         rv = apr_socket_connect(newsock, backend_addr);



-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message