]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: filters: Set last_entity when a filter fails on stream_start callback
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Mar 2026 09:56:52 +0000 (10:56 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 5 Mar 2026 14:34:47 +0000 (15:34 +0100)
On the stream, the last_entity should reference the last rule or the last
filter evaluated during the stream processing. However, this info was not
saved when a filter failed on strem_start callback function. It is now
fixed.

This patch could be backported as far as 3.1.

src/filters.c

index 2add2ab79be4ba564f3510d77e9c840a3be1469b..9775348bc9bae16101ad393f2836e88a6b03dd36 100644 (file)
@@ -528,8 +528,11 @@ flt_stream_start(struct stream *s)
        list_for_each_entry(filter, &strm_flt(s)->filters, list) {
                if (FLT_OPS(filter)->stream_start) {
                        filter->calls++;
-                       if (FLT_OPS(filter)->stream_start(s, filter) < 0)
+                       if (FLT_OPS(filter)->stream_start(s, filter) < 0) {
+                               s->last_entity.type = STRM_ENTITY_FILTER;
+                               s->last_entity.ptr = filter;
                                return -1;
+                       }
                }
        }
        if (strm_li(s) && (strm_li(s)->bind_conf->analysers & AN_REQ_FLT_START_FE)) {