From 08cbac1689bfc112b30a5e707d68bd0d11671990 Mon Sep 17 00:00:00 2001 From: James Crayne Date: Fri, 1 Jun 2018 03:27:45 +0000 Subject: canonicalize ip upon sessionPacketH --- src/Network/Tox/Crypto/Handlers.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Network') diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index 6f20e670..d3bf9606 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs @@ -859,7 +859,8 @@ handshakeH sessions addrRaw hshake@(Handshake (Cookie n24 ecookie) nonce24 encry return Nothing sessionPacketH :: NetCryptoSessions -> SockAddr -> CryptoPacket Encrypted -> IO (Maybe (x -> x)) -sessionPacketH sessions addr (CryptoPacket nonce16 encrypted) = do +sessionPacketH sessions addrRaw (CryptoPacket nonce16 encrypted) = do + let addr = either id id $ either4or6 addrRaw dput XNetCrypto ("RECIEVED CRYPTOPACKET from " ++ show addr) let crypto = transportCrypto sessions allsessions = netCryptoSessions sessions -- cgit v1.2.3