summaryrefslogtreecommitdiff
path: root/src/util/proxy_protocol_client.pl
diff options
context:
space:
mode:
authorTodd Lyons <tlyons@exim.org>2014-05-12 16:15:07 -0700
committerTodd Lyons <tlyons@exim.org>2014-05-13 11:21:51 -0700
commit367193425cbb5a77ee8ada9c5b2a203ca293d823 (patch)
treeaeefd2bae73ce4d997baf6182263b5ef6621c554 /src/util/proxy_protocol_client.pl
parentfabe4dd996dd1e08707c4c33c498d86deaae6edd (diff)
Bug 1394: PPv2 header modifed
The HAProxy dev team adjusted the layout of the 16 byte header to allow it to be used for SSL connections. Had to adjust PPv2 handling code and perl proxy emulation script. Added link to this HAProxy commit in the documentation.
Diffstat (limited to 'src/util/proxy_protocol_client.pl')
-rw-r--r--src/util/proxy_protocol_client.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/proxy_protocol_client.pl b/src/util/proxy_protocol_client.pl
index 7cfc13ddc..feae3ca90 100644
--- a/src/util/proxy_protocol_client.pl
+++ b/src/util/proxy_protocol_client.pl
@@ -82,10 +82,10 @@ sub generate_preamble {
if (!$opts{version} || $opts{version} == 2) {
@preamble = (
"\x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A", # 12 byte v2 header
- "\x02", # declares v2
- "\x01", # connection is proxied
+ "\x21", # top 4 bits declares v2
+ # bottom 4 bits is command
$opts{6} ? "\x21" : "\x11", # inet6/4 and TCP (stream)
- $opts{6} ? "\x24" : "\x0b", # 36 bytes / 12 bytes
+ $opts{6} ? "\x00\x24" : "\x00\x0b", # 36 bytes / 12 bytes
$source_ip,
$dest_ip,
$source_port,