only ignore SYN packet because it can be the start of a QUIC handshake too

master
Christian Ulrich 2020-11-18 00:10:36 +01:00
parent 5f03151f81
commit a04254b07e
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 3 additions and 1 deletions

View File

@ -70,7 +70,9 @@ 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":
if msg == "SYN":
# We received a SYN packet. We ignore it because we expected it to be
# filtered by our NAT.
return
echo &"handling ACK message from {peerIp}:{peerPort}"
let (_, myPort) = puncher.sock.getLocalAddr()