]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: listener: implement GUID support
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 2 Apr 2024 08:44:08 +0000 (10:44 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 5 Apr 2024 13:40:42 +0000 (15:40 +0200)
commit0489d85263853709b1c08a1f2a5da18bcbdbb474
tree3f5941efec61bf8de406782ff39eea126eb188ed
parent82594569815c994f3035addda04c9b8642df55c5
MINOR: listener: implement GUID support

This commit is similar with the two previous ones. Its purpose is to add
GUID support on listeners. Due to bind_conf and listeners configuration,
some specifities were required.

Its possible to define several listeners on a single bind line, for
example by specifying multiple addresses. As such, it's impossible to
support a "guid" keyword on a bind line. The problem is exacerbated by
the cloning of listeners when sharding is used.

To resolve this, a new keyword "guid-prefix" is defined for bind lines.
It allows to specify a string which will be used as a prefix for
automatically generated GUID for each listeners attached to a bind_conf.

Automatic GUID listeners generation is implemented via a new function
bind_generate_guid(). It is called on post-parsing, after
bind_complete_thread_setup(). For each listeners on a bind_conf, a new
GUID is generated with bind_conf prefix and the index of the listener
relative to other listeners in the bind_conf. This last value is stored
in a new bind_conf field named <guid_idx>. If a GUID cannot be inserted,
for example due to a non-unique value, an error is returned, startup is
interrupted with configuration rejected.
doc/configuration.txt
include/haproxy/listener-t.h
include/haproxy/listener.h
src/cfgparse.c
src/guid.c
src/listener.c
src/proxy.c