From 8fe8f784739bf9d117d2e31ccc0e0e46bd424cb0 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 29 Apr 2026 15:08:45 +0200 Subject: [PATCH] MINOR: connection: define mask CO_FL_WAIT_XPRT_L6 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 | 2 ++ src/connection.c | 2 +- src/xprt_qmux.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/haproxy/connection-t.h b/include/haproxy/connection-t.h index 1cff9f3ee..891d278f9 100644 --- a/include/haproxy/connection-t.h +++ b/include/haproxy/connection-t.h @@ -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 */ diff --git a/src/connection.c b/src/connection.c index 99ca36c1f..07ee95149 100644 --- a/src/connection.c +++ b/src/connection.c @@ -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; diff --git a/src/xprt_qmux.c b/src/xprt_qmux.c index 4060ec566..56e68edba 100644 --- a/src/xprt_qmux.c +++ b/src/xprt_qmux.c @@ -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; -- 2.47.3