haproxy: use correct ip version on client supplied address

When a user supplies an IP address to use for the HAPROXY protocol,
the IP version reported must be deduced from the address and has
no relation to the IP version used for the upstream connection.

Add test3220 to verify.

Fixes #21340
Reported-by: Fiona Klute
Closes #21341
This commit is contained in:
Stefan Eissing 2026-04-16 13:44:13 +02:00 committed by Daniel Stenberg
parent 021a87cf81
commit 70281e39be
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 86 additions and 10 deletions

View file

@ -51,7 +51,7 @@ proxy
# Strip off the (random) local port number. This test used to use a fixed
# local port number that frequently causes the test to fail
<strippart>
s/^PROXY TCP6 2001:db8:: ::1 (\d*) %HTTP6PORT/proxy-line/
s/^PROXY TCP6 2001:db8:: 2001:db8:: (\d*) %HTTP6PORT/proxy-line/
</strippart>
<protocol crlf="yes">
proxy-line