]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: checks: Don't forget to set the "alt_proto" field
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 20 Apr 2026 09:58:57 +0000 (11:58 +0200)
committerOlivier Houchard <cognet@ci0.org>
Mon, 20 Apr 2026 09:59:44 +0000 (11:59 +0200)
The target address type has been added to checks in commit
d759e60a3292f425aee66384e87ae227ce191c08, but as part of that address
type is the "alt_proto" field, that was not properly set for dynamic
servers, That could lead to checks not working for any protocol that use
a non-zero alt_proto, such as QUIC. So set it properly.

src/check.c

index 481cab22fb2dd5a410b89749ec0cc2308c84ca92..077956559ca4ec7dffa5ba9dc39d35a8bb6ef777 100644 (file)
@@ -1839,8 +1839,11 @@ int init_srv_check(struct server *srv)
                        if (srv->check.port) {
                                srv->check.addr_type.proto_type = PROTO_TYPE_STREAM;
                                srv->check.addr_type.xprt_type = PROTO_TYPE_STREAM;
-                       } else
+                               srv->check.alt_proto = 0;
+                       } else {
                                srv->check.addr_type = srv->addr_type;
+                               srv->check.alt_proto = srv->alt_proto;
+                       }
                }
                if (net_addr_type_is_quic(&srv->check.addr_type))
                        srv->check.xprt = xprt_get(XPRT_QUIC);