From e85fa96cf7744aefca828fdb99812b31ddb2d762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Tue, 4 Dec 2018 15:23:28 +0100 Subject: [PATCH] Proxy protocol may send additional data after addresses --- src/proxy_protocol.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/proxy_protocol.erl b/src/proxy_protocol.erl index 232f9cca3..2103a4004 100644 --- a/src/proxy_protocol.erl +++ b/src/proxy_protocol.erl @@ -109,7 +109,8 @@ decode_v2(SockMod, Socket, Timeout) -> <> -> + SP:16/big-unsigned-integer, + _/binary>> -> {{{S1, S2, S3, S4}, SP}, {{D1, D2, D3, D4}, DP}}; _ -> @@ -135,7 +136,8 @@ decode_v2(SockMod, Socket, Timeout) -> S7:16/big-unsigned-integer, S8:16/big-unsigned-integer, DP:16/big-unsigned-integer, - SP:16/big-unsigned-integer>> -> + SP:16/big-unsigned-integer, + _/binary>> -> {{{S1, S2, S3, S4, S5, S6, S7, S8}, SP}, {{D1, D2, D3, D4, D5, D6, D7, D8}, DP}}; _ ->