Shut down when no IPv4/6 routing available
Would fake-connect without VPN icon otherwise.
This commit is contained in:
parent
c565e32dcd
commit
9b8be02c2a
|
@ -129,6 +129,9 @@ extension TunnelKitProvider {
|
|||
/// An error occurred at the link level.
|
||||
case linkError
|
||||
|
||||
/// Network routing information is missing or incomplete.
|
||||
case routing
|
||||
|
||||
/// The current network changed (e.g. switched from WiFi to data connection).
|
||||
case networkChanged
|
||||
|
||||
|
|
|
@ -696,6 +696,9 @@ extension TunnelKitProvider {
|
|||
|
||||
case .failedLinkWrite:
|
||||
return .linkError
|
||||
|
||||
case .noRouting:
|
||||
return .routing
|
||||
|
||||
default:
|
||||
return .unexpectedReply
|
||||
|
|
|
@ -76,6 +76,9 @@ public enum SessionError: String, Error {
|
|||
|
||||
/// Server uses compression.
|
||||
case serverCompression
|
||||
|
||||
/// Missing routing information.
|
||||
case noRouting
|
||||
}
|
||||
|
||||
extension Error {
|
||||
|
|
|
@ -957,6 +957,11 @@ public class SessionProxy {
|
|||
}
|
||||
|
||||
pushReply = reply
|
||||
guard reply.options.ipv4 != nil || reply.options.ipv6 != nil else {
|
||||
deferStop(.shutdown, SessionError.noRouting)
|
||||
return
|
||||
}
|
||||
|
||||
completeConnection()
|
||||
|
||||
guard let remoteAddress = link?.remoteAddress else {
|
||||
|
|
Loading…
Reference in New Issue