Aurelien DARRAGON 837a26ab05 BUG/MEDIUM: server/lbprm: fix crash in _srv_set_inetaddr_port()
Since faa8c3e ("MEDIUM: lb-chash: Deterministic node hashes based on
server address") the following configuration will cause haproxy to crash:

  backend test1
       mode http
       balance hash int(1)
       server s1 haproxy.org:80

This is because lbprm.update_server_eweight() method is now systematically
called in _srv_set_inetaddr_port() upon srv addr/port change (and with the
above config it happens during startup after initial dns resolution).

However, depending on the chosen lbprm algo, update_server_eweight function
may not be set (it is not a mandatory method, some lb implementations don't
define it).

Thus, using 'balance hash' with map-based hashing or 'balance sticky' will
cause a crash due to a NULL de-reference in _srv_set_inetaddr_port(). To
fix the issue, we first check that the update_server_eweight() method is
set before using it.

No backport needed unless faa8c3e ("MEDIUM: lb-chash: Deterministic node
hashes based on server address") gets backported.
2024-04-03 11:58:03 +02:00
..
2024-04-02 07:27:33 +02:00
2024-04-02 07:27:33 +02:00
2024-04-02 07:27:33 +02:00
2024-04-02 07:27:33 +02:00
2024-04-02 07:27:33 +02:00
2024-04-02 07:27:33 +02:00
2024-04-02 07:27:33 +02:00
2024-04-02 07:27:33 +02:00