Check for UNSPEC gateway within adapter

This commit is contained in:
Sergey Abramchuk
2017-05-20 11:21:38 +03:00
parent 07c9058554
commit 37cfcbd0b2
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ bool OpenVPNClient::tun_builder_set_remote_address(const std::string &address, b
bool OpenVPNClient::tun_builder_add_address(const std::string &address, int prefix_length, const std::string &gateway, bool ipv6, bool net30) {
NSString *localAddress = [NSString stringWithUTF8String:address.c_str()];
NSString *gatewayAddress = !gateway.empty() && gateway.compare("UNSPEC") != 0 ? [NSString stringWithUTF8String:gateway.c_str()] : nil;
NSString *gatewayAddress = [NSString stringWithUTF8String:gateway.c_str()];
return [(__bridge OpenVPNAdapter *)adapter addLocalAddress:localAddress prefixLength:@(prefix_length) gateway:gatewayAddress isIPv6:ipv6];
}