Skip to content

Conversation

@masaori335
Copy link
Contributor

Fix #8544.

Prior to this change, the source address in the PROXY Protocol message was set as the remote address when it was parsed.
Now, %<chi> always represents the previous hop.


if (netvc->has_proxy_protocol(reader)) {
Debug("proxyprotocol", "ioCompletionEvent: http has proxy protocol header");
netvc->set_remote_addr(netvc->get_proxy_protocol_src_addr());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change.


if (this->has_proxy_protocol(buffer, &r)) {
Debug("proxyprotocol", "ssl has proxy protocol header");
set_remote_addr(get_proxy_protocol_src_addr());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we can unify these code in the SSLNetVConnection and ProtocolProbeSessionAccept, but it's out of scope from this PR.

@masaori335
Copy link
Contributor Author

The doc of %<chi> is updated.

@masaori335 masaori335 merged commit cc2979d into apache:master Jul 5, 2022
@zwoop
Copy link
Contributor

zwoop commented Jul 7, 2022

It kinda feels like this is borderline incompatible change, in that the logging behavior of %{chi} could possibly change. The odds of this happening is small, but we should consider this and make sure we don't break the compatibility contracts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add "logging field" to identify proxy protocol client's IP address (previous proxy hop)

4 participants