Skip to content

Conversation

@maskit
Copy link
Member

@maskit maskit commented Feb 12, 2025

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.

@maskit maskit added this to the 10.1.0 milestone Feb 12, 2025
@maskit maskit self-assigned this Feb 12, 2025
@bneradt bneradt self-requested a review February 24, 2025 23:22
@cmcfarlen cmcfarlen modified the milestones: 10.1.0, 10.2.0 Mar 10, 2025
@bryancall
Copy link
Contributor

[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
Copy link
Contributor

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?

Copy link
Member Author

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

@maskit maskit merged commit c4c31de into apache:master May 14, 2025
15 checks passed
cmcfarlen pushed a commit to cmcfarlen/trafficserver that referenced this pull request Jul 10, 2025
* 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)
@cmcfarlen cmcfarlen moved this to For v10.1.0 in ATS v10.1.x Jul 10, 2025
@cmcfarlen cmcfarlen moved this from For v10.1.0 to picked v10.1.0 in ATS v10.1.x Jul 10, 2025
@cmcfarlen cmcfarlen modified the milestones: 10.2.0, 10.1.0 Jul 10, 2025
@cmcfarlen
Copy link
Contributor

Cherry-picked to 10.1.x branch

cmcfarlen pushed a commit that referenced this pull request Jul 10, 2025
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: picked v10.1.0

Development

Successfully merging this pull request may close these issues.

5 participants