]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: fix filtering of closing connections on "show quic"
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 9 Feb 2023 17:18:45 +0000 (18:18 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 9 Feb 2023 17:30:14 +0000 (18:30 +0100)
Filtering of closing/draining connections on "show quic" was not
properly implemented. This causes the extra argument "all" to display
all connections to be without effect. This patch fixes this and restores
the output of all connections.

This must be backported up to 2.7.

src/quic_conn.c

index 631f2f2e86915769c18621f149e56ee242fe9848..c93484ca694faf473b191d563486730bf786dd01 100644 (file)
@@ -7636,13 +7636,13 @@ static int cli_parse_show_quic(char **args, char *payload, struct appctx *appctx
        if (!cli_has_level(appctx, ACCESS_LVL_OPER))
                return 1;
 
-       if (*args[2] && strcmp(args[2], "all") == 0)
-               ctx->flags |= QC_CLI_FL_SHOW_ALL;
-
        ctx->epoch = _HA_ATOMIC_FETCH_ADD(&qc_epoch, 1);
        ctx->thr = 0;
        ctx->flags = 0;
 
+       if (*args[2] && strcmp(args[2], "all") == 0)
+               ctx->flags |= QC_CLI_FL_SHOW_ALL;
+
        LIST_INIT(&ctx->bref.users);
 
        return 0;
@@ -7706,7 +7706,7 @@ static int cli_io_handler_dump_quic(struct appctx *appctx)
                        continue;
                }
 
-               if (!ctx->flags & QC_CLI_FL_SHOW_ALL &&
+               if (!(ctx->flags & QC_CLI_FL_SHOW_ALL) &&
                    qc->flags & (QUIC_FL_CONN_CLOSING|QUIC_FL_CONN_DRAINING)) {
                        ctx->bref.ref = qc->el_th_ctx.n;
                        continue;