mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-02 05:52:18 +00:00
OpenVPN: Default gateway not set properly in some cases (#1087)
Regression from TunnelKit, the parser was not handling multiple redirect-gateway directives correctly.
This commit is contained in:
parent
7ecd37e6ba
commit
8514bf24f2
@ -477,9 +477,9 @@ extension StandardOpenVPNParser.Builder {
|
||||
|
||||
var args = components
|
||||
args.removeFirst()
|
||||
optRedirectGateway = Set(args.compactMap {
|
||||
optRedirectGateway?.formUnion(Set(args.compactMap {
|
||||
RedirectGateway(rawValue: $0)
|
||||
})
|
||||
}))
|
||||
|
||||
case .routeNoPull:
|
||||
optRouteNoPull = true
|
||||
|
@ -188,6 +188,15 @@ final class PushReplyTests: XCTestCase {
|
||||
XCTFail("Unable to parse reply: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
func test_givenMultipleRedirectGateway_whenParse_thenIncludesRoutingPolicies() throws {
|
||||
let msg = "PUSH_REPLY,redirect-gateway def1,redirect-gateway bypass-dhcp,redirect-gateway autolocal,dhcp-option DNS 8.8.8.8,route-gateway 10.8.0.1,topology subnet,ping 10,ping-restart 20,ifconfig 10.8.0.2 255.255.255.0,peer-id 0,cipher AES-256-GCM"
|
||||
|
||||
let reply = try parser.pushReply(with: msg)
|
||||
reply?.debug()
|
||||
|
||||
XCTAssertEqual(reply?.options.routingPolicies, [.IPv4])
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
|
Loading…
Reference in New Issue
Block a user