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.
|
/// An error occurred at the link level.
|
||||||
case linkError
|
case linkError
|
||||||
|
|
||||||
|
/// Network routing information is missing or incomplete.
|
||||||
|
case routing
|
||||||
|
|
||||||
/// The current network changed (e.g. switched from WiFi to data connection).
|
/// The current network changed (e.g. switched from WiFi to data connection).
|
||||||
case networkChanged
|
case networkChanged
|
||||||
|
|
||||||
|
|
|
@ -697,6 +697,9 @@ extension TunnelKitProvider {
|
||||||
case .failedLinkWrite:
|
case .failedLinkWrite:
|
||||||
return .linkError
|
return .linkError
|
||||||
|
|
||||||
|
case .noRouting:
|
||||||
|
return .routing
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return .unexpectedReply
|
return .unexpectedReply
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,9 @@ public enum SessionError: String, Error {
|
||||||
|
|
||||||
/// Server uses compression.
|
/// Server uses compression.
|
||||||
case serverCompression
|
case serverCompression
|
||||||
|
|
||||||
|
/// Missing routing information.
|
||||||
|
case noRouting
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Error {
|
extension Error {
|
||||||
|
|
|
@ -957,6 +957,11 @@ public class SessionProxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
pushReply = reply
|
pushReply = reply
|
||||||
|
guard reply.options.ipv4 != nil || reply.options.ipv6 != nil else {
|
||||||
|
deferStop(.shutdown, SessionError.noRouting)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
completeConnection()
|
completeConnection()
|
||||||
|
|
||||||
guard let remoteAddress = link?.remoteAddress else {
|
guard let remoteAddress = link?.remoteAddress else {
|
||||||
|
|
Loading…
Reference in New Issue