BUG/MINOR: connection: parse PROXY TLV for LOCAL mode

conn_recv_proxy() is responsible to parse PROXY protocol header. For v2
of the protocol, TLVs parsing is implemented. However, this step was
only done inside 'PROXY' command label. TLVs were never extracted for
'LOCAL' command mode.

Fix this by extracting TLV parsing loop outside of the switch case. Of
notable importance, tlv_offset is updated on LOCAL label to point to
first TLV location.

This bug should be backported up to 2.9 at least. It should even
probably be backported to every stable versions. Note however that this
code has changed much over time. It may be useful to use option
'--ignore-all-space' to have a clearer overview of the git diff.

(cherry picked from commit 8b72270e95c965a9672457c3af0de3093c06ba61)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit 6c32fe36e9f833ac334c421759cecc580931cec4)
 [ad: context adjustment]
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit 5c6f20b0d7ad6e24e459555a4ee1b4e1e9c4502d)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
(cherry picked from commit 76bc84c2c4d3c246defef94768709cba3dab7e40)
 [ad: context adjustment]
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
1 file changed