]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: config: Improve warnings on misplaced rules by adding an optional arg
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Nov 2024 08:28:41 +0000 (09:28 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Nov 2024 08:28:42 +0000 (09:28 +0100)
commit7710580428c1a413348fd48641ad7d4e54ee5b68
tree2bc877f354f9d2762224551e92de33ce5ac97048
parentc329bfe3f5e3479d40a735f7c72fd0d27c46b397
MINOR: config: Improve warnings on misplaced rules by adding an optional arg

In warnings about misplaced rules, only the first keyword is mentionned. It
works well for http-request or quic-initial rules for instance. But it is a
bit confusing for tcp-request rules, because the layer is missing (session
or content).

To make it a bit systematic (and genric), the second argument can now be
provided. It can be set to NULL if there is no layer or scope. But
otherwise, it may be specified and it will be reported in the warning.

So the following snippet:

    tcp-request content reject if FALSE
    tcp-request session reject if FALSE
    tcp-request connection reject if FALSE

Will now emit the following warnings:

  a 'tcp-request session' rule placed after a 'tcp-request content' rule will still be processed before.
  a 'tcp-request connection' rule placed after a 'tcp-request session' rule will still be processed before.

This patch should fix the issue #2596.
include/haproxy/cfgparse.h
src/cfgparse-listen.c
src/cfgparse-quic.c
src/tcp_rules.c