-
Notifications
You must be signed in to change notification settings - Fork 845
Add TSVConnPPInfoGet #12032
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
Add TSVConnPPInfoGet #12032
Conversation
|
[approve ci autest 2] |
| Return the particular PROXY protocol info requested. | ||
| @param vconn the vconection pointer | ||
| @param key the requested PROXY protocol info. One of TSVConnPPInfoKey or TLV type ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one has to be a TSVConnPPInfoKey value, right? Should it take a TSVConnPPInfoKey type rather than a uint16_t?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because it can be a non-standard value.
https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
The following range of 16 type values is reserved for application-specific
data and will be never used by the PROXY Protocol. If you need more values
consider extending the range with a type field in your TLVs.
#define PP2_TYPE_MIN_CUSTOM 0xE0
#define PP2_TYPE_MAX_CUSTOM 0xEF
This range of 8 values is reserved for temporary experimental use by
application developers and protocol designers. The values from the range will
never be used by the PROXY protocol and should not be used by production
functionality.
#define PP2_TYPE_MIN_EXPERIMENT 0xF0
#define PP2_TYPE_MAX_EXPERIMENT 0xF7
The following range of 8 values is reserved for future use, potentially to
extend the protocol with multibyte type values.
#define PP2_TYPE_MIN_FUTURE 0xF8
#define PP2_TYPE_MAX_FUTURE 0xFF
* Add TSVConnPPInfoGet * Set socket type in PPv1 parser as well * Fix nullptr dereference * Change tye type of key parameter to uint16_t (cherry picked from commit c4c31de)
|
Cherry-picked to 10.1.x branch |
* Add TSVConnPPInfoGet * Set socket type in PPv1 parser as well * Fix nullptr dereference * Change tye type of key parameter to uint16_t (cherry picked from commit c4c31de)
https://lists.apache.org/thread/nzr39cdvf7277crkf0gf82b7201qxzb8
The API is only tested with PROXY protocol version 1 that doesn't support TLV. I could use Proxy Verifier to use PROXY protocol version 2, but it doesn't seem like to support sending TLV. The PROXY protocol parser itself is tested by unit tests.