]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stats-file: silently ignore be/fe mistmatch
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 19 Nov 2024 15:39:55 +0000 (16:39 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 19 Nov 2024 15:44:51 +0000 (16:44 +0100)
Most of the invalid or unknow field in the stats-file parser are ignored
silently, which is not the case of the frontend/backend mismatch on a
guid, which is kind of strange.

Since this is ""documented"" to be ignored in the
reg-tests/stats/sample-stats-file file, let's also ignore this kind of
line. This will allow to run the associated reg-test with -dW.

src/stats-file.c

index cc1b636ce984fe78aeb11f89ff2ab35638ba8a05..ae8e40fef1146084c0b5ee47e554dc309dd03bfb 100644 (file)
@@ -279,13 +279,13 @@ static int parse_stat_line(struct ist line,
 
                if (domain == STFILE_DOMAIN_PX_FE) {
                        if (!(px->cap & PR_CAP_FE))
-                               goto err;
+                               return 0; /* silently ignored fe/be mismatch */
                        base_off = (char *)&px->fe_counters;
                        off = 0;
                }
                else if (domain == STFILE_DOMAIN_PX_BE) {
                        if (!(px->cap & PR_CAP_BE))
-                               goto err;
+                               return 0; /* silently ignored fe/be mismatch */
                        base_off = (char *)&px->be_counters;
                        off = 1;
                }