]> git.kaiwu.me - haproxy.git/commit
MINOR: server: prevent name collision with a default-server
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 31 Jul 2026 14:23:08 +0000 (16:23 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 3 Aug 2026 14:52:09 +0000 (16:52 +0200)
commit1420edd834f142084330810dcf36ff6c977a6d25
treed00fa123f83fe4fb21de14f047113733f64ec0bc
parent507f790af73903cd1f5f448bc78fb60038bc7cb3
MINOR: server: prevent name collision with a default-server

The previous patch has introduced the support for named default-server.
It is not possible though to declare a default-server with a name if it
collides with an already existing server instance.

This patch implements a similar check but on the other side : it ensures
that a newly created server instance does not collide with an already
existing default-server.

To implement this, a new function server_find_by_name2() is defined. It
is similar to server_find_by_name() except it also lookup in the named
default-server tree. Checks are performed on several places :
* _srv_parse_init() for a server parsing
* _srv_parse_tmpl_init() for a server-template parsing
* srv_update_server_name() for the CLI command "set server name"
* cli_parse_add_server() for the CLI command "add server"
include/haproxy/server.h
src/server.c