From dc7c94ed0d295906a5637594855c4c8f24ee5849 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Tue, 17 Nov 2020 23:44:13 +0100 Subject: [PATCH] only handle ACK messages, not SYN (we expect them to be filtered by our NAT) --- puncher.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/puncher.nim b/puncher.nim index 11a6562..abddddb 100644 --- a/puncher.nim +++ b/puncher.nim @@ -70,6 +70,8 @@ proc handleMsg*(puncher: Puncher, msg: string, peerIp: IpAddress, peerPort: Port) = ## Handles an incoming UDP message which may complete the Futures returned by ## ``initiate`` and ``respond``. + if msg != "ACK": + return let (_, myPort) = puncher.sock.getLocalAddr() let query = Attempt(srcPort: myPort, dstIp: peerIp, dstPorts: @[peerPort]) let i = puncher.attempts.find(query)