Willy Tarreau
b6fc524f05
MINOR: ssl: make tlskeys_list_get_next() take a list element
As reported in issue #1010, gcc-11 as of 2021-01-05 is overzealous in its -Warray-bounds check as it considers that a cast of a global struct accesses the entire struct even if only one specific element is accessed. This instantly breaks all lists making use of container_of() to build their iterators as soon as the starting point is known if the next element is retrieved from the list head in a way that is visible to the compiler's optimizer, because it decides that accessing the list's next element dereferences the list as a larger struct (which it does not). The temporary workaround consisted in disabling -Warray-bounds, but this warning is traditionally quite effective at spotting real bugs, and we actually have is a single occurrence of this issue in the whole code. By changing the tlskeys_list_get_next() function to take a list element as the starting point instead of the current element, we can avoid the starting point issue but this requires to change all call places to write hideous casts made of &((struct blah*)ref)->list. At the moment we only have two such call places, the first one being used to initialize the list (which is the one causing the warning) and which is thus easy to simplify, and the second one for which we already have an aliased pointer to the reference that is still valid at the call place, and given the original pointer also remained unchanged, we can safely use this alias, and this is safer than leaving a cast there. Let's make this change now while it's still easy. The generated code only changed in function cli_io_handler_tlskeys_files() due to register allocation and the change of variable scope between the old one and the new one.
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)
Description
Languages
Shell
100%