From 7d2a92346d53bf7380a5080fb671bc3d26ebffad Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Wed, 26 Aug 2020 21:33:13 +0200 Subject: [PATCH] don't force 3 ports / sequence numbers --- punchd.nim | 8 ++++---- tcp_syni.nim | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/punchd.nim b/punchd.nim index 8da9654..8802d2f 100644 --- a/punchd.nim +++ b/punchd.nim @@ -20,15 +20,15 @@ type # Requests TcpSyniConnect = object srcIp: IpAddress - srcPorts: array[3, Port] + srcPorts: seq[Port] dstIp: IpAddress - dstPorts: array[3, Port] + dstPorts: seq[Port] TcpSyniAccept = object dstIp: IpAddress - dstPorts: array[3, Port] + dstPorts: seq[Port] srcIp: IpAddress - srcPorts: array[3, Port] + srcPorts: seq[Port] seqNums: seq[uint32] proc handleSigint() {.noconv.} = diff --git a/tcp_syni.nim b/tcp_syni.nim index fd9a719..1bf4ae1 100644 --- a/tcp_syni.nim +++ b/tcp_syni.nim @@ -98,7 +98,7 @@ proc captureAndResendAck(puncher: TcpSyniPuncher, captureFd: AsyncFD, await injectFd.injectTcpPacket(parsed) return -proc initPuncher*(srcPort: Port, dstIp: IpAddress, dstPorts: array[3, Port], +proc initPuncher*(srcPort: Port, dstIp: IpAddress, dstPorts: seq[Port], seqNums: seq[uint32] = @[]): TcpSyniPuncher = let localIp = getPrimaryIPAddr(dstIp) # TODO: do real port prediction