]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: proto_reverse_connect: fix preconnect with startup name resolution
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 21 Sep 2023 13:44:17 +0000 (15:44 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 21 Sep 2023 14:57:30 +0000 (16:57 +0200)
commit9b6812d7812170c645783d69ea1afbb7c67f1644
treef97831f7ec0eb0489844ae47d6c365b12c302416
parent6a9ba853221e42adcdb2aead8c59f898e2769ab0
BUG/MINOR: proto_reverse_connect: fix preconnect with startup name resolution

addr member of server structure is not set consistently depending on the
server address type. When using <IP:PORT> notation, its port is properly
set. However, when using <HOSTNAME:PORT>, only IP address is set after
startup name resolution but its port is left to 0.

This behavior causes preconnect to not be functional when using server
with hostname for startup name resolution. Indeed, only srv.addr is used
as connect argument through function new_reverse_conn(). To fix this,
rely on srv.svc_port : this member is always set for servers using IP or
hostname. This is similar to connect_server() on the backend side.

This does not need to be backported.
src/proto_reverse_connect.c