mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-25 12:01:10 +01:00
BUG/MEDIUM: peers: Peer addresses parsing broken.
This bug was introduced by 355b203 commit which prevented the peer addresses to be parsed for the local peer of a "peers" section. When adding "parse_addr" boolean parameter to parse_server(), this commit missed the case where the syntax with "peer" keyword should still be supported in addition to the new syntax with "server"+"bind" keyword. May be backported as fas as 1.5.
This commit is contained in:
parent
a9b7796862
commit
04636b7bac
@ -761,8 +761,9 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
|
||||
}
|
||||
else if (strcmp(args[0], "peer") == 0 ||
|
||||
strcmp(args[0], "server") == 0) { /* peer or server definition */
|
||||
int local_peer;
|
||||
int local_peer, peer;
|
||||
|
||||
peer = *args[0] == 'p';
|
||||
local_peer = !strcmp(args[1], localpeer);
|
||||
/* The local peer may have already partially been parsed on a "bind" line. */
|
||||
if (*args[0] == 'p') {
|
||||
@ -805,7 +806,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
|
||||
}
|
||||
|
||||
/* This initializes curpeer->peers->peers_fe->srv. */
|
||||
err_code |= parse_server(file, linenum, args, curpeers->peers_fe, NULL, !local_peer);
|
||||
err_code |= parse_server(file, linenum, args, curpeers->peers_fe, NULL, peer || !local_peer);
|
||||
if (!curpeers->peers_fe->srv)
|
||||
goto out;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user