fix return value of find*Attempt procs

This commit is contained in:
Christian Ulrich 2020-10-02 17:18:31 +02:00
parent 84cb8611ef
commit 9e3b7fe987
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 2 additions and 0 deletions

View File

@ -141,6 +141,7 @@ proc findConnectAttempt(puncher: TcpSyniPuncher, srcIp: IpAddress,
attempt.dstIp == dstIp and attempt.dstIp == dstIp and
attempt.dstPorts.any(proc (p: Port): bool = p in dstPorts): attempt.dstPorts.any(proc (p: Port): bool = p in dstPorts):
return index return index
return -1
proc findAcceptAttempt(puncher: TcpSyniPuncher, srcIp: IpAddress, proc findAcceptAttempt(puncher: TcpSyniPuncher, srcIp: IpAddress,
srcPort: Port, dstIp: IpAddress, srcPort: Port, dstIp: IpAddress,
@ -150,6 +151,7 @@ proc findAcceptAttempt(puncher: TcpSyniPuncher, srcIp: IpAddress,
attempt.dstIp == dstIp and attempt.dstIp == dstIp and
attempt.dstPorts.any(proc (p: Port): bool = p in dstPorts): attempt.dstPorts.any(proc (p: Port): bool = p in dstPorts):
return index return index
return -1
proc findAcceptAttemptsByLocalAddr(puncher: TcpSyniPuncher, address: IpAddress, proc findAcceptAttemptsByLocalAddr(puncher: TcpSyniPuncher, address: IpAddress,
port: Port): seq[AcceptAttempt] = port: Port): seq[AcceptAttempt] =