BUG/MINOR: backend: fix target address retrieval in transparent mode
A very old bug resulting from some code refactoring causes
assign_server_address() to refrain from retrieving the destination
address from the client-side connection when transparent mode is
enabled and we're connecting to a server which has address 0.0.0.0.
The impact is low since such configurations are unlikely to ever
be encountered. The fix should be backported to older branches.
diff --git a/src/backend.c b/src/backend.c
index 7689cea..c2e286a 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -725,8 +725,7 @@
* the client asked, which is handy for remapping ports
* locally on multiple addresses at once.
*/
- if (!(s->be->options & PR_O_TRANSP))
- conn_get_to_addr(s->req->prod->conn);
+ conn_get_to_addr(s->req->prod->conn);
if (s->req->prod->conn->addr.to.ss_family == AF_INET) {
((struct sockaddr_in *)&s->req->cons->conn->addr.to)->sin_addr = ((struct sockaddr_in *)&s->req->prod->conn->addr.to)->sin_addr;
@@ -740,8 +739,7 @@
if (objt_server(s->target)->state & SRV_MAPPORTS) {
int base_port;
- if (!(s->be->options & PR_O_TRANSP))
- conn_get_to_addr(s->req->prod->conn);
+ conn_get_to_addr(s->req->prod->conn);
/* First, retrieve the port from the incoming connection */
base_port = get_host_port(&s->req->prod->conn->addr.to);