]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: backend: refactor specific source address allocation
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 2 Oct 2023 15:17:15 +0000 (17:17 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 3 Oct 2023 15:49:12 +0000 (17:49 +0200)
commitbd001ff346da42e5f5c4019e4fa10b13d59f9526
treeeea6e571f0232be38b54ec6e43e2fbefad821f42
parent2ac5d9a6573791a6fe4e959afc40657ff06b0aed
MINOR: backend: refactor specific source address allocation

Refactor alloc_bind_address() function which is used to allocate a
sockaddr if a connection to a target server relies on a specific source
address setting.

The main objective of this change is to be able to use this function
outside of backend module, namely for preconnections using a reverse
server. As such, this function is now exported globally.

For reverse connect, there is no stream instance. As such, the function
parts which relied on it were reduced to the minimal. Now, stream is
only used if a non-static address is configured which is useful for
usesrc client|clientip|hdr_ip. These options have no sense for reverse
connect so it should be safe to use the same function.
include/haproxy/backend.h
src/backend.c