diff options
author | JuanJo Ciarlante <jjo@google.com> | 2009-11-11 15:35:31 +0100 |
---|---|---|
committer | JuanJo Ciarlante <juanjosec@gmail.com> | 2011-03-25 13:30:30 +0100 |
commit | 9d4c64b584173789780431e5fd5acf977cf72e9d (patch) | |
tree | 2ded8f89e663eacce051a30f5a353ebba7bd5cd6 | |
parent | efa85c8b086121dc5df0e07b110751077e3d1ec4 (diff) | |
download | openvpn-9d4c64b584173789780431e5fd5acf977cf72e9d.tar.gz openvpn-9d4c64b584173789780431e5fd5acf977cf72e9d.tar.xz openvpn-9d4c64b584173789780431e5fd5acf977cf72e9d.zip |
* polished redirect-gateway (ipv4 on ipv6 endpoints) support
-rw-r--r-- | route.c | 2 | ||||
-rw-r--r-- | socket.c | 2 | ||||
-rw-r--r-- | socket.h | 6 |
3 files changed, 8 insertions, 2 deletions
@@ -581,7 +581,7 @@ redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, u if (!local) { /* route remote host to original default gateway */ - if (rl->spec.remote_host != 0xffffffff) { + if (rl->spec.remote_host != IPV4_INVALID_ADDR) { add_route3 (rl->spec.remote_host, ~0, rl->spec.net_gateway, @@ -2147,7 +2147,7 @@ link_socket_current_remote (const struct link_socket_info *info) */ #ifdef USE_PF_INET6 if (lsa->actual.dest.addr.sa.sa_family != AF_INET) - return 0xffffffff; + return IPV4_INVALID_ADDR; #else ASSERT (lsa->actual.dest.addr.sa.sa_family == AF_INET); #endif @@ -383,6 +383,12 @@ void setenv_link_socket_actual (struct env_set *es, void bad_address_length (int actual, int expected); +#ifdef USE_PF_INET6 +/* IPV4_INVALID_ADDR: returned by link_socket_current_remote() + * to ease redirect-gateway logic for ipv4 tunnels on ipv6 endpoints + */ +#define IPV4_INVALID_ADDR 0xffffffff +#endif in_addr_t link_socket_current_remote (const struct link_socket_info *info); void link_socket_connection_initiated (const struct buffer *buf, |