only use one destination port for now

This commit is contained in:
Christian Ulrich 2020-08-26 21:34:35 +02:00
parent 7d2a92346d
commit 7b4f3b790e
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ proc initPuncher*(srcPort: Port, dstIp: IpAddress, dstPorts: seq[Port],
seqNums: seq[uint32] = @[]): TcpSyniPuncher = seqNums: seq[uint32] = @[]): TcpSyniPuncher =
let localIp = getPrimaryIPAddr(dstIp) let localIp = getPrimaryIPAddr(dstIp)
# TODO: do real port prediction # TODO: do real port prediction
var predictedDstPorts = newSeq[Port](3) var predictedDstPorts = newSeq[Port](1)
let basePort = min(dstPorts[1].uint16, let basePort = min(dstPorts[1].uint16,
uint16.high - (predictedDstPorts.len - 1).uint16) uint16.high - (predictedDstPorts.len - 1).uint16)
for i in 0 .. predictedDstPorts.len - 1: for i in 0 .. predictedDstPorts.len - 1: