]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stream: don't mistake match rules for store-request rules
authorJerome Magnin <jmagnin@haproxy.com>
Thu, 16 Jan 2020 16:37:21 +0000 (17:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 16 Jan 2020 17:07:52 +0000 (18:07 +0100)
commitbee00ad080ff9359df8a670e891a6c2bce4acc39
tree94c5730e645d5c8052757404ebce0e3f34ca593c
parentd308c5e0cef224940b65fd2641b55fa9d00328a8
BUG/MINOR: stream: don't mistake match rules for store-request rules

In process_sticking_rules() we only want to apply the first store-request
rule for a given table, but when doing so we need to make sure we only
count actual store-request rules when we list the sticking rules.

Failure to do so leads to not being able to write store-request and match
sticking rules in any order as a match rule after a store-request rule
will be ignored.

The following configuration reproduces the issue:

  global
    stats socket /tmp/foobar

  defaults
    mode http

  frontend in
    bind *:8080
    default_backend bar

  backend bar
    server s1 127.0.0.1:21212
    server s2 127.0.0.1:21211
    stick store-request req.hdr(foo)
    stick match req.hdr(foo)
    stick-table type string size 10

  listen foo
    bind *:21212
    bind *:21211
    http-request deny deny_status 200 if { dst_port 21212 }
    http-request deny

This patch fixes issue #448 and should be backported as far as 1.6.
src/stream.c