mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 04:02:15 +02:00
Removed the first two parameters from tun_builder_reroute_gw
(const std::string& server_address and bool server_address_ipv6) because they are redundant. The same info is passed via tun_builder_set_remote_address.
This commit is contained in:
parent
7d4201a853
commit
fbf3f82ee0
@ -58,7 +58,7 @@ public class OpenVPNClientThread extends ClientAPI_OpenVPNClient implements Runn
|
||||
|
||||
boolean tun_builder_set_remote_address(String address, boolean ipv6);
|
||||
boolean tun_builder_add_address(String address, int prefix_length, String gateway, boolean ipv6, boolean net30);
|
||||
boolean tun_builder_reroute_gw(String server_address, boolean server_address_ipv6, boolean ipv4, boolean ipv6, long flags);
|
||||
boolean tun_builder_reroute_gw(boolean ipv4, boolean ipv6, long flags);
|
||||
boolean tun_builder_add_route(String address, int prefix_length, boolean ipv6);
|
||||
boolean tun_builder_exclude_route(String address, int prefix_length, boolean ipv6);
|
||||
boolean tun_builder_add_dns_server(String address, boolean ipv6);
|
||||
@ -263,10 +263,10 @@ public class OpenVPNClientThread extends ClientAPI_OpenVPNClient implements Runn
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean tun_builder_reroute_gw(String server_address, boolean server_address_ipv6, boolean ipv4, boolean ipv6, long flags) {
|
||||
public boolean tun_builder_reroute_gw(boolean ipv4, boolean ipv6, long flags) {
|
||||
TunBuilder tb = tun_builder;
|
||||
if (tb != null)
|
||||
return tb.tun_builder_reroute_gw(server_address, server_address_ipv6, ipv4, ipv6, flags);
|
||||
return tb.tun_builder_reroute_gw(ipv4, ipv6, flags);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
@ -53,16 +53,11 @@ namespace openvpn {
|
||||
}
|
||||
|
||||
// Callback to reroute default gateway to VPN interface.
|
||||
// server_address is provided so that the implementation may exclude
|
||||
// it from the default route.
|
||||
// server_address_ipv6 is true if server_address is an IPv6 address.
|
||||
// ipv4 is true if the default route to be added should be IPv4.
|
||||
// ipv6 is true if the default route to be added should be IPv6.
|
||||
// flags are defined in RedirectGatewayFlags
|
||||
// Never called more than once per tun_builder session.
|
||||
virtual bool tun_builder_reroute_gw(const std::string& server_address,
|
||||
bool server_address_ipv6,
|
||||
bool ipv4,
|
||||
virtual bool tun_builder_reroute_gw(bool ipv4,
|
||||
bool ipv6,
|
||||
unsigned int flags)
|
||||
{
|
||||
|
@ -177,7 +177,7 @@ namespace openvpn {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool tun_builder_reroute_gw(const std::string& server_address, bool server_address_ipv6, bool ipv4, bool ipv6, unsigned int flags)
|
||||
virtual bool tun_builder_reroute_gw(bool ipv4, bool ipv6, unsigned int flags)
|
||||
{
|
||||
reroute_gw.ipv4 = ipv4;
|
||||
reroute_gw.ipv6 = ipv6;
|
||||
|
@ -284,9 +284,7 @@ namespace openvpn {
|
||||
reroute_gw_ver_flags |= F_IPv6;
|
||||
|
||||
// call reroute_gw builder method
|
||||
if (!tb->tun_builder_reroute_gw(server_addr.to_string(),
|
||||
server_addr.version() == IP::Addr::V6,
|
||||
(reroute_gw_ver_flags & F_IPv4) ? true : false,
|
||||
if (!tb->tun_builder_reroute_gw((reroute_gw_ver_flags & F_IPv4) ? true : false,
|
||||
(reroute_gw_ver_flags & F_IPv6) ? true : false,
|
||||
rg_flags()))
|
||||
throw tun_prop_route_error("tun_builder_reroute_gw for redirect-gateway failed");
|
||||
|
Loading…
Reference in New Issue
Block a user