]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sockpair: use conn->dst for the target address in ->connect()
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Jul 2019 14:42:04 +0000 (16:42 +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_sockpair.c

index a4faa370a623e76e141eb14b91cad381696631d0..163666799f2d2a50772370089a1519fa2ab14e0e 100644 (file)
@@ -215,7 +215,7 @@ int send_fd_uxst(int fd, int send_fd)
  * This function works like uxst_connect_server but instead of creating a
  * socket and establishing a connection, it creates a pair of connected
  * sockets, and send one of them through the destination FD. The destination FD
- * is stored in addr.to->sin_addr.s_addr during configuration parsing.
+ * is stored in conn->dst->sin_addr.s_addr during configuration parsing.
  *
  * 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
@@ -242,7 +242,7 @@ static int sockpair_connect_server(struct connection *conn, int flags)
        int sv[2], fd, dst_fd = -1;
 
        /* the FD is stored in the sockaddr struct */
-       dst_fd = ((struct sockaddr_in *)&conn->addr.to)->sin_addr.s_addr;
+       dst_fd = ((struct sockaddr_in *)conn->dst)->sin_addr.s_addr;
 
        if (obj_type(conn->target) != OBJ_TYPE_PROXY &&
            obj_type(conn->target) != OBJ_TYPE_SERVER) {