]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: peers: only the last peers section was used by tables
authorWilly Tarreau <w@1wt.eu>
Thu, 17 Jan 2013 20:34:52 +0000 (21:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Jan 2013 20:34:52 +0000 (21:34 +0100)
Due to a typo in the peers section lookup code, the last declared peers
section was used instead of the one matching the requested name. This bug
has been there since the very first commit on peers section (1.5-dev2).

src/cfgparse.c

index abcb9c5866819db4745a425583e98fe609b39bd8..87fbcfff3e0386bf08688fe215b790682e18164c 100644 (file)
@@ -6192,7 +6192,7 @@ int check_config_validity()
                        for (curpeers = peers; curpeers; curpeers = curpeers->next) {
                                if (strcmp(curpeers->id, curproxy->table.peers.name) == 0) {
                                        free((void *)curproxy->table.peers.name);
-                                       curproxy->table.peers.p = peers;
+                                       curproxy->table.peers.p = curpeers;
                                        break;
                                }
                        }