diff options
author | Bernhard Schmidt <berni@debian.org> | 2020-10-20 19:17:07 +0200 |
---|---|---|
committer | Bernhard Schmidt <berni@debian.org> | 2020-10-20 19:17:07 +0200 |
commit | 63934be0e9a494086d103bc3ba43c444b5460b5b (patch) | |
tree | e2b5876072df6d56023d21a66379544e2bef9d5f /src/openvpn/route.c | |
parent | 4ca7910f8fbd80a28780cff34d27b481ae882f67 (diff) | |
parent | 80285c31e83a8e233016e227a393543d508194eb (diff) |
Update upstream source from tag 'upstream/2.5_rc3'
Update to upstream version '2.5~rc3'
with Debian dir 654a857be97a3895ea7ff814fea7c3f9f80e8794
Diffstat (limited to 'src/openvpn/route.c')
-rw-r--r-- | src/openvpn/route.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/openvpn/route.c b/src/openvpn/route.c index d75aa5f..5e1dca6 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -1011,14 +1011,10 @@ redirect_default_route_to_vpn(struct route_list *rl, const struct tuntap *tt, * - we are connecting to a non-IPv4 remote host (i.e. we use IPv6) */ else if (!(rl->rgi.flags & RGI_ADDR_DEFINED) && !local - && (rl->spec.remote_host != IPV4_INVALID_ADDR)) + && (rl->spec.flags & RTSA_REMOTE_HOST)) { msg(M_WARN, "%s Cannot read current default gateway from system", err); } - else if (!(rl->spec.flags & RTSA_REMOTE_HOST)) - { - msg(M_WARN, "%s Cannot obtain current remote host address", err); - } else { #ifndef TARGET_ANDROID @@ -1041,7 +1037,8 @@ redirect_default_route_to_vpn(struct route_list *rl, const struct tuntap *tt, /* route remote host to original default gateway */ /* if remote_host is not ipv4 (ie: ipv6), just skip * adding this special /32 route */ - if (rl->spec.remote_host != IPV4_INVALID_ADDR) + if ((rl->spec.flags & RTSA_REMOTE_HOST) + && rl->spec.remote_host != IPV4_INVALID_ADDR) { add_route3(rl->spec.remote_host, IPV4_NETMASK_HOST, @@ -1479,6 +1476,13 @@ setenv_route_ipv6(struct env_set *es, const struct route_ipv6 *r6, int i) buf_printf( &name2, "route_ipv6_gateway_%d", i ); setenv_str( es, BSTR(&name2), print_in6_addr( r6->gateway, 0, &gc )); + + if (r6->flags & RT_METRIC_DEFINED) + { + struct buffer name3 = alloc_buf_gc( 256, &gc ); + buf_printf( &name3, "route_ipv6_metric_%d", i) ; + setenv_int( es, BSTR(&name3), r6->metric); + } } gc_free(&gc); } |