BUG/MINOR: check: fix the condition to validate a port-less server
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Jul 2021 09:06:41 +0000 (11:06 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 27 Jul 2021 06:37:12 +0000 (08:37 +0200)
commit97e8d84ffd52eaa460c5f6f3baec805cbc5f888b
treec3660856ca194f2eab009253e0a702961081e919
parent20d15662a56b9402d3d34a18aba851c45c14b22e
BUG/MINOR: check: fix the condition to validate a port-less server

A config like the below fails to validate because of a bogus test:

  backend b1
      tcp-check connect port 1234
      option tcp-check
      server s1 1.2.3.4 check

[ALERT] (18887) : config : config: proxy 'b1': server 's1' has neither
                  service port nor check port, and a tcp_check rule
                  'connect' with no port information.

A || instead of a && only validates the connect rule when both the
address *and* the port are set. A work around is to set the rule like
this:

      tcp-check connect addr 0:1234 port 1234

This needs to be backported as far as 2.2 (2.0 is OK).

(cherry picked from commit acff30975341a907784e489e3a7e384f3550211e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 565f333088e59a3a45509237cdcdc3e5ae3602ea)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/check.c