]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: conn: Do not check 'sess_el' list on frontend connections in __trace_enabled
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Mon, 17 Aug 2026 15:48:09 +0000 (17:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 17 Aug 2026 17:09:10 +0000 (19:09 +0200)
When called on a frontend connection, the 'sess_el' list that is checked
in '__trace_enabled' was never initialized (see 'conn_backend_init' and
'conn_frontend_init').

This patch can be backported to all stable branches.

src/trace.c

index 9e66bed143430f2f33be3af18e183686820499d0..c7570f726804865d0a6e04adb25ffcbebeea60f4 100644 (file)
@@ -151,7 +151,7 @@ int __trace_enabled(enum trace_level level, uint64_t mask, struct trace_source *
 #endif
        if (!ctx.sess && ctx.strm)
                ctx.sess = ctx.strm->sess;
-       else if (!ctx.sess && ctx.conn && LIST_INLIST(&ctx.conn->sess_el))
+       else if (!ctx.sess && ctx.conn && conn_is_back(ctx.conn) && LIST_INLIST(&ctx.conn->sess_el))
                ctx.sess = ctx.conn->owner;
        else if (!ctx.sess && ctx.check)
                ctx.sess = ctx.check->sess;