]> granicus.if.org Git - ejabberd/commitdiff
Proxy protocol may send additional data after addresses
authorPaweł Chmielowski <pchmielowski@process-one.net>
Tue, 4 Dec 2018 14:23:28 +0000 (15:23 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Tue, 4 Dec 2018 14:23:28 +0000 (15:23 +0100)
src/proxy_protocol.erl

index 232f9cca3ef30bf68ef9c3fa9cff7c9c8a13f4df..2103a40044b8fbddfae807dd51035c2e097d4deb 100644 (file)
@@ -109,7 +109,8 @@ decode_v2(SockMod, Socket, Timeout) ->
                                        <<D1:8, D2:8, D3:8, D4:8,
                                          S1:8, S2:8, S3:8, S4:8,
                                          DP:16/big-unsigned-integer,
-                                         SP:16/big-unsigned-integer>> ->
+                                         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}};
                                        _ ->