Assume stale session if server sends HARD_RESET
When unsolicited.
This commit is contained in:
parent
1dcf4d7745
commit
0f2234f1d1
|
@ -479,13 +479,22 @@ public class OpenVPNSession: Session {
|
||||||
// deferStop(.shutdown, e)
|
// deferStop(.shutdown, e)
|
||||||
// return
|
// return
|
||||||
}
|
}
|
||||||
if (code == .hardResetServerV2) && (negotiationKey.controlState == .connected) {
|
switch code {
|
||||||
|
case .hardResetServerV2:
|
||||||
|
guard negotiationKey.state == .hardReset else {
|
||||||
deferStop(.shutdown, OpenVPNError.staleSession)
|
deferStop(.shutdown, OpenVPNError.staleSession)
|
||||||
return
|
return
|
||||||
} else if (code == .softResetV1) && !negotiationKey.softReset {
|
}
|
||||||
|
|
||||||
|
case .softResetV1:
|
||||||
|
if !negotiationKey.softReset {
|
||||||
softReset(isServerInitiated: true)
|
softReset(isServerInitiated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
sendAck(for: controlPacket)
|
sendAck(for: controlPacket)
|
||||||
|
|
||||||
let pendingInboundQueue = controlChannel.enqueueInboundPacket(packet: controlPacket)
|
let pendingInboundQueue = controlChannel.enqueueInboundPacket(packet: controlPacket)
|
||||||
|
|
Loading…
Reference in New Issue