MINOR: proto_reverse_connect: support source address setting
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 2 Oct 2023 15:17:46 +0000 (17:17 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 3 Oct 2023 15:50:36 +0000 (17:50 +0200)
commit90873dc6780dd1ec8a8e0d07799f10cabbe8f423
tree51bc1fb1521bac90365a13e1c4f6c5766382c28c
parentbd001ff346da42e5f5c4019e4fa10b13d59f9526
MINOR: proto_reverse_connect: support source address setting

Support backend configuration for explicit source address on
pre-connect. These settings can be specified via "source" backend
keyword or directly on the server line.

Previously, all source parameters triggered a BUG_ON() when binding a
reverse connect listener. This was done because some settings are
incompatible with reverse connect context : this is the case for all
source settings which do not specify a fixed address but rather rely on
a frontend connection. Indeed, in case of preconnect, connection is
initiated on its own without the existence of a previous frontend
connection.

This patch allows to use a source parameter with a fixed address. All
other settings (usesrc client/clientip/hdr_ip) are rejected on listener
binding. On connection init, alloc_bind_address() is used to set the
optional source address.
src/proto_reverse_connect.c