must await all calls to injectTcpPacket before closing rawFd

This commit is contained in:
Christian Ulrich 2020-10-07 00:03:46 +02:00
parent 99658cb49c
commit 572b443ea0
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 1 additions and 1 deletions

View File

@ -296,7 +296,7 @@ proc accept*(puncher: TcpSyniPuncher, srcPort: Port, dstIp: IpAddress,
tcpSeqNumber: seqNum, tcpAckNumber: 0,
tcpFlags: {SYN}, tcpWindowSize: 1452 * 10)
echo &"[{ipPacket.ipAddrSrc}:{ipPacket.tcpPortSrc} -> {ipPacket.ipAddrDst}:{ipPacket.tcpPortDst}, SEQ {ipPacket.tcpSeqNumber}] injecting SYN"
asyncCheck rawFd.injectTcpPacket(ipPacket)
await rawFd.injectTcpPacket(ipPacket)
closeSocket(rawFd)
await attempt.future or sleepAsync(Timeout)
await attempt.deleteFirewallRules()