]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: unix: use conn->dst for the target address in ->connect()
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Jul 2019 14:40:37 +0000 (16:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 19 Jul 2019 11:50:09 +0000 (13:50 +0200)
No extra check is needed since the destination must be set there.

src/proto_uxst.c

index 66093af65a6cf4cfb86db2f24ea0f0d755dff7fc..513f34dad73c55ca4648f3eed3a58fe75f64eb59 100644 (file)
@@ -409,7 +409,7 @@ static int uxst_pause_listener(struct listener *l)
 
 /*
  * This function initiates a UNIX connection establishment to the target assigned
- * to connection <conn> using (si->{target,addr.to}). The source address is ignored
+ * to connection <conn> using (si->{target,dst}). The source address is ignored
  * and will be selected by the system. conn->target may point either to a valid
  * server or to a backend, depending on conn->target. Only OBJ_TYPE_PROXY and
  * OBJ_TYPE_SERVER are supported. The <data> parameter is a boolean indicating
@@ -519,7 +519,7 @@ static int uxst_connect_server(struct connection *conn, int flags)
        if (global.tune.server_rcvbuf)
                 setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &global.tune.server_rcvbuf, sizeof(global.tune.server_rcvbuf));
 
-       if (connect(fd, (struct sockaddr *)&conn->addr.to, get_addr_len(&conn->addr.to)) == -1) {
+       if (connect(fd, (struct sockaddr *)conn->dst, get_addr_len(conn->dst)) == -1) {
                if (errno == EINPROGRESS || errno == EALREADY) {
                        conn->flags |= CO_FL_WAIT_L4_CONN;
                }