]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: connection: define mask CO_FL_WAIT_XPRT_L6
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 29 Apr 2026 13:08:45 +0000 (15:08 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 21 May 2026 13:09:10 +0000 (15:09 +0200)
Define a new connection flag mask CO_FL_WAIT_XPRT_L6. This will be used
to indicate that a XPRT layer is running on top of layer 6. For now,
only xprt_qmux implements this method of operation.

include/haproxy/connection-t.h
src/connection.c
src/xprt_qmux.c

index 1cff9f3ee00a54bf1a8954153f8133d9cb093442..891d278f9b1e98456c48d6a8c1608dcbb484c8ec 100644 (file)
@@ -179,6 +179,8 @@ enum {
        /* below we have all handshake flags grouped into one */
        CO_FL_HANDSHAKE     = CO_FL_SEND_PROXY | CO_FL_ACCEPT_PROXY | CO_FL_ACCEPT_CIP | CO_FL_SOCKS4_SEND | CO_FL_SOCKS4_RECV,
        CO_FL_WAIT_XPRT     = CO_FL_WAIT_L4_CONN | CO_FL_HANDSHAKE | CO_FL_WAIT_L6_CONN,
+       /* handshake running on top of a layer6 */
+       CO_FL_WAIT_XPRT_L6  = CO_FL_QMUX_SEND | CO_FL_QMUX_RECV,
 
        CO_FL_SSL_WAIT_HS   = 0x08000000,  /* wait for an SSL handshake to complete */
 
index 99ca36c1f1a95f75700f34a4e6eec7833ab38a02..07ee95149e445c092e66a6ddbf3fc557bff54075 100644 (file)
@@ -196,7 +196,7 @@ int conn_notify_mux(struct connection *conn, int old_flags, int forced_wake)
         * information to create one, typically from the ALPN. If we're
         * done with the handshake, attempt to create one.
         */
-       if (unlikely(!conn->mux) && !(conn->flags & (CO_FL_WAIT_XPRT|CO_FL_QMUX_RECV|CO_FL_QMUX_SEND))) {
+       if (unlikely(!conn->mux) && !(conn->flags & (CO_FL_WAIT_XPRT|CO_FL_WAIT_XPRT_L6))) {
                ret = conn_create_mux(conn, NULL);
                if (ret < 0)
                        goto done;
index 4060ec566e14c31c93116d7e9613516a265c0c0b..56e68edba2d2d1f4d5d6e89d40f34ae8e7655fbf 100644 (file)
@@ -210,7 +210,7 @@ struct task *xprt_qmux_io_cb(struct task *t, void *context, unsigned int state)
 
  out:
        if ((conn->flags & CO_FL_ERROR) ||
-           !(conn->flags & (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND))) {
+           !(conn->flags & CO_FL_WAIT_XPRT_L6)) {
                /* XPRT should be unsubscribed when transfer done or on error. */
                BUG_ON(ctx->wait_event.events);
 
@@ -335,7 +335,7 @@ static void xprt_qmux_close(struct connection *conn, void *xprt_ctx)
        if (ctx->ops_lower && ctx->ops_lower->close)
                ctx->ops_lower->close(conn, ctx->ctx_lower);
 
-       conn->flags &= ~(CO_FL_QMUX_RECV|CO_FL_QMUX_SEND);
+       conn->flags &= ~CO_FL_WAIT_XPRT_L6;
 
        BUG_ON(conn->xprt_ctx != ctx);
        conn->xprt_ctx = ctx->ctx_lower;