From 887e2ae55d23b1b060d5fb771324696c565dd803 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Wed, 17 Apr 2019 01:26:39 +0200 Subject: [PATCH] Consider stale if HARD_RESET while connected Was disconnecting when more than one HARD_RESET_SERVER was received during negotiation. --- TunnelKit/Sources/Core/SessionProxy.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TunnelKit/Sources/Core/SessionProxy.swift b/TunnelKit/Sources/Core/SessionProxy.swift index c93d200..7ab56d3 100644 --- a/TunnelKit/Sources/Core/SessionProxy.swift +++ b/TunnelKit/Sources/Core/SessionProxy.swift @@ -519,7 +519,7 @@ public class SessionProxy { // deferStop(.shutdown, e) // return } - if (code == .hardResetServerV2) && (negotiationKey.state != .hardReset) { + if (code == .hardResetServerV2) && (negotiationKey.controlState == .connected) { deferStop(.shutdown, SessionError.staleSession) return } else if (code == .softResetV1) && (negotiationKey.state != .softReset) {