Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--haproxy-clientip sets destination IP, not client IP #11619

Closed
bagder opened this issue Aug 8, 2023 Discussed in #11613 · 2 comments
Closed

--haproxy-clientip sets destination IP, not client IP #11619

bagder opened this issue Aug 8, 2023 Discussed in #11613 · 2 comments

Comments

@bagder
Copy link
Member

bagder commented Aug 8, 2023

Discussed in #11613

Originally posted by marsom August 7, 2023
Hi,

ok I'm probably wrong, I expected the from following curl:

curl --ipv4 --haproxy-clientip 192.168.1.2 http://localhost:8080

to set the client ip in the proxy protocol header to 192.168.1.2. in the proxy protocol naming for me its the source ip not the destination.

but

result = Curl_dyn_addf(&ctx->data_out, "PROXY %s %s %s %i %i\r\n",

sets the destination address.

when i read ie.

i think the client ip = source ip

if I dump the payload from the command obove i get

PROXY TCP4 127.0.0.1 192.168.1.2 62190 8080
GET / HTTP/1.1
Host: localhost:8080
User-Agent: curl/8.2.1
Accept: */*
...
@bagder
Copy link
Member Author

bagder commented Aug 8, 2023

/cc @RaitoBezarius

bagder added a commit that referenced this issue Aug 8, 2023
... as documented.

Update test 3201 and 3202 accordingly.

Reported-by: Markus Sommer
Fixes #11619
@bagder bagder closed this as completed in f0fed4e Aug 8, 2023
@RaitoBezarius
Copy link
Contributor

Apologies for this and thank you @bagder — you were faster than me to fix it… :)

ptitSeb pushed a commit to wasix-org/curl that referenced this issue Sep 25, 2023
... as documented.

Update test 3201 and 3202 accordingly.

Reported-by: Markus Sommer
Fixes curl#11619
Closes curl#11626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants