From 9fac0cec0e78f07df5c442727f72e71474727fbe Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Wed, 14 Oct 2020 20:51:32 +0200 Subject: [PATCH] cosmetic changes; add FIXMEs --- tcp_syni_accept.nim | 6 +++--- tcp_syni_connect.nim | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tcp_syni_accept.nim b/tcp_syni_accept.nim index c3803b2..2d36a67 100644 --- a/tcp_syni_accept.nim +++ b/tcp_syni_accept.nim @@ -54,7 +54,7 @@ proc doAccept(puncher: TcpSyniAcceptPuncher, srcIp: IpAddress, srcPort: Port) {.async.} = let sock = newAsyncSocket() sock.setSockOpt(OptReuseAddr, true) - sock.bindAddr(srcPort, $(srcIp)) + sock.bindAddr(srcPort, $srcIp) sock.listen() while true: let acceptFuture = sock.accept() @@ -96,10 +96,10 @@ proc accept*(puncher: TcpSyniAcceptPuncher, srcPort: Port, dstIp: IpAddress, seqNums: seqNums, future: newFuture[AsyncSocket]("accept")) puncher.attempts.add(attempt) - await attempt.addFirewallRules() + await attempt.addFirewallRules() # FIXME: needed? await attempt.injectSynPackets() await attempt.future or sleepAsync(Timeout) - await attempt.deleteFirewallRules() + await attempt.deleteFirewallRules() # FIXME: needed? puncher.attempts.del(puncher.attempts.find(attempt)) if attempt.future.finished(): result = attempt.future.read() diff --git a/tcp_syni_connect.nim b/tcp_syni_connect.nim index 8e2fce6..330a5f5 100644 --- a/tcp_syni_connect.nim +++ b/tcp_syni_connect.nim @@ -108,7 +108,7 @@ proc connect*(puncher: TcpSyniConnectPuncher, srcPort: Port, dstIp: IpAddress, let connectFuture = newFuture[AsyncSocket]("connect") for dstPort in attempt.dstPorts: asyncCheck doConnect(attempt.srcIp, attempt.srcPort, attempt.dstIp, - dstPort, connectfuture) + dstPort, connectFuture) await connectFuture or sleepAsync(Timeout) await attempt.deleteFirewallRules() puncher.attempts.del(puncher.attempts.find(attempt))