summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanJo Ciarlante <jjo@google.com>2009-11-11 15:35:31 +0100
committerJuanJo Ciarlante <juanjosec@gmail.com>2011-03-25 13:30:30 +0100
commit9d4c64b584173789780431e5fd5acf977cf72e9d (patch)
tree2ded8f89e663eacce051a30f5a353ebba7bd5cd6
parentefa85c8b086121dc5df0e07b110751077e3d1ec4 (diff)
downloadopenvpn-9d4c64b584173789780431e5fd5acf977cf72e9d.tar.gz
openvpn-9d4c64b584173789780431e5fd5acf977cf72e9d.tar.xz
openvpn-9d4c64b584173789780431e5fd5acf977cf72e9d.zip
* polished redirect-gateway (ipv4 on ipv6 endpoints) support
-rw-r--r--route.c2
-rw-r--r--socket.c2
-rw-r--r--socket.h6
3 files changed, 8 insertions, 2 deletions
diff --git a/route.c b/route.c
index f3ed974..cf10334 100644
--- a/route.c
+++ b/route.c
@@ -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,
diff --git a/socket.c b/socket.c
index 2d46d3f..72da792 100644
--- a/socket.c
+++ b/socket.c
@@ -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
diff --git a/socket.h b/socket.h
index f864ab1..5f1e800 100644
--- a/socket.h
+++ b/socket.h
@@ -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,