]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: peers: crash on reload without local peer.
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 4 Oct 2019 06:30:04 +0000 (08:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 Oct 2019 08:21:04 +0000 (10:21 +0200)
commit5a4fe5a35d544579586672c46f8afe4114589d91
tree2d5a079a9b1132d5b95cd94e93c92a965e77339f
parent07308677ddcc7f47567a98f51ad0c0bd0e3a49a0
BUG/MINOR: peers: crash on reload without local peer.

When we configure a "peers" section without local peer, this makes haproxy
old process crash on reload.

Such a configuration file allows to reproduce this issue:

  global
    stats socket /tmp/sock1 mode 666 level admin
    stats timeout 10s

  peers peers
    peer localhost 127.0.0.1:1024

This bug was introduced by this commit:
  "MINOR: cfgparse: Make "peer" lines be parsed as "server" lines"

This commit introduced a new condition to detect a "peers" section without
local peer. This is a "peers" section with a frontend struct which has no ->id
initialized member. Such a "peers" section must be removed.

This patch adds this new condition to remove such peers sections without local
peer as this was always done before.

Must be backported to 2.0.
src/cfgparse.c