From 99912b4b6969258ed61591f64320aca41da04faf Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Sat, 10 Oct 2020 12:35:36 +0200 Subject: [PATCH] rawFd -> injectFd --- tcp_syni.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tcp_syni.nim b/tcp_syni.nim index c4f4fc4..e3c48db 100644 --- a/tcp_syni.nim +++ b/tcp_syni.nim @@ -254,7 +254,7 @@ proc doAccept(puncher: TcpSyniPuncher, srcIp: IpAddress, sock.close() proc injectSynPackets(attempt: AcceptAttempt) {.async.} = - let rawFd = setupTcpInjectingSocket() + let injectFd = setupTcpInjectingSocket() for dstPort in attempt.dstPorts: let synOut = IpPacket(protocol: tcp, ipAddrSrc: attempt.srcIp, ipAddrDst: attempt.dstIp, ipTTL: 2, @@ -262,7 +262,7 @@ proc injectSynPackets(attempt: AcceptAttempt) {.async.} = tcpSeqNumber: rand(uint32), tcpAckNumber: 0, tcpFlags: {SYN}, tcpWindowSize: 1452 * 10) echo &"[{synOut.ipAddrSrc}:{synOut.tcpPortSrc} -> {synOut.ipAddrDst}:{synOut.tcpPortDst}, SEQ {synOut.tcpSeqNumber}] injecting outgoing SYN" - await rawFd.injectTcpPacket(synOut) + await injectFd.injectTcpPacket(synOut) for seqNum in attempt.seqNums: let synIn = IpPacket(protocol: tcp, ipAddrSrc: attempt.dstIp, ipAddrDst: attempt.srcIp, ipTTL: 64, @@ -271,8 +271,8 @@ proc injectSynPackets(attempt: AcceptAttempt) {.async.} = tcpSeqNumber: seqNum, tcpAckNumber: 0, tcpFlags: {SYN}, tcpWindowSize: 1452 * 10) echo &"[{synIn.ipAddrSrc}:{synIn.tcpPortSrc} -> {synIn.ipAddrDst}:{synIn.tcpPortDst}, SEQ {synIn.tcpSeqNumber}] injecting incoming SYN" - await rawFd.injectTcpPacket(synIn) - closeSocket(rawFd) + await injectFd.injectTcpPacket(synIn) + closeSocket(injectFd) proc accept*(puncher: TcpSyniPuncher, srcPort: Port, dstIp: IpAddress, dstPorts: seq[Port],