From: JuanJo Ciarlante Date: Tue, 10 Nov 2009 22:46:46 +0000 (+0100) Subject: * (prototype) fix for supporting "redirect-gateway" for tunneled ipv4 over ipv6 endpoints X-Git-Tag: v2.3-alpha1~240^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=efa85c8b086121dc5df0e07b110751077e3d1ec4;p=thirdparty%2Fopenvpn.git * (prototype) fix for supporting "redirect-gateway" for tunneled ipv4 over ipv6 endpoints --- diff --git a/route.c b/route.c index b5092fe30..f3ed974cd 100644 --- a/route.c +++ b/route.c @@ -581,13 +581,17 @@ redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, u if (!local) { /* route remote host to original default gateway */ - add_route3 (rl->spec.remote_host, - ~0, - rl->spec.net_gateway, - tt, - flags, - es); - rl->did_local = true; + if (rl->spec.remote_host != 0xffffffff) { + add_route3 (rl->spec.remote_host, + ~0, + rl->spec.net_gateway, + tt, + flags, + es); + rl->did_local = true; + } else { + dmsg (D_ROUTE, "ROUTE remote_host protocol differs from tunneled"); + } } /* route DHCP/DNS server traffic through original default gateway */ diff --git a/socket.c b/socket.c index bade47e1f..2d46d3f33 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 0; + return 0xffffffff; #else ASSERT (lsa->actual.dest.addr.sa.sa_family == AF_INET); #endif