must await all calls to injectTcpPacket before closing rawFd
This commit is contained in:
parent
99658cb49c
commit
572b443ea0
|
@ -296,7 +296,7 @@ proc accept*(puncher: TcpSyniPuncher, srcPort: Port, dstIp: IpAddress,
|
||||||
tcpSeqNumber: seqNum, tcpAckNumber: 0,
|
tcpSeqNumber: seqNum, tcpAckNumber: 0,
|
||||||
tcpFlags: {SYN}, tcpWindowSize: 1452 * 10)
|
tcpFlags: {SYN}, tcpWindowSize: 1452 * 10)
|
||||||
echo &"[{ipPacket.ipAddrSrc}:{ipPacket.tcpPortSrc} -> {ipPacket.ipAddrDst}:{ipPacket.tcpPortDst}, SEQ {ipPacket.tcpSeqNumber}] injecting SYN"
|
echo &"[{ipPacket.ipAddrSrc}:{ipPacket.tcpPortSrc} -> {ipPacket.ipAddrDst}:{ipPacket.tcpPortDst}, SEQ {ipPacket.tcpSeqNumber}] injecting SYN"
|
||||||
asyncCheck rawFd.injectTcpPacket(ipPacket)
|
await rawFd.injectTcpPacket(ipPacket)
|
||||||
closeSocket(rawFd)
|
closeSocket(rawFd)
|
||||||
await attempt.future or sleepAsync(Timeout)
|
await attempt.future or sleepAsync(Timeout)
|
||||||
await attempt.deleteFirewallRules()
|
await attempt.deleteFirewallRules()
|
||||||
|
|
Loading…
Reference in New Issue