]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: servers: Make assign_tproxy_address work when ALPN is set.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 17 Jan 2019 14:59:13 +0000 (15:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Jan 2019 18:18:20 +0000 (19:18 +0100)
If an ALPN is set on the server line, then when we reach assign_tproxy_address,
the stream_interface's endpoint will be a connection, not a conn_stream,
so make sure assign_tproxy_address() handles both cases.

This should be backported to 1.9.

src/backend.c

index ab5a629c5d4983c833a8d5d9b709eefe40fb9d65..3e327975e0813c0e1d5e0d6e6ac0a3c7101498cb 100644 (file)
@@ -1021,7 +1021,12 @@ static void assign_tproxy_address(struct stream *s)
        struct server *srv = objt_server(s->target);
        struct conn_src *src;
        struct connection *cli_conn;
-       struct connection *srv_conn = cs_conn(objt_cs(s->si[1].end));
+       struct connection *srv_conn;
+
+       if (objt_cs(s->si[1].end))
+               srv_conn = cs_conn(__objt_cs(s->si[1].end));
+       else
+               srv_conn = objt_conn(s->si[1].end);
 
        if (srv && srv->conn_src.opts & CO_SRC_BIND)
                src = &srv->conn_src;