Message-ID: <4F704D97.6040701@...1702...> Date: Mon, 26 Mar 2012 13:05:59 +0200 From: Samuel CUELLA MIME-Version: 1.0 References: <4F6C9753.1080002@...1702...> In-Reply-To: <4F6C9753.1080002@...1702...> Subject: Re: [Openvpn-devel] [openvpn-devel] OpenVPN 2.1.4/Linux: route-gatewy not working List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit To: openvpn-devel@lists.sourceforge.net, David Sommerseth On 03/23/2012 03:34 PM, David Sommerseth wrote: > > Hi Samuel, > > Interesting finding you've found here. However, we're not developing the > 2.1 branch any more. So if you could try the latest git master branch > [1], that'd be great ... And if that still fails, try to apply your patch > to see if that improves it. > > There has been some fixes to the whole routing part in 2.2 and 2.3, so we > need to be sure we're not fixing something which is fixed in a different way. > I've just tested with the git master: same problem with the exact same cause. My patch just create an empty route list and set appropriate flags, just like "redirect-gateway". I've also noted that redirect_default_route_to_vpn() will only apply the pushed default route if a default route already exist on the client. If there is no default route, the pushed default route won't be applied. Is that an expected/desired behavior ? Here is the patch against the latest git master: ---- Author: Samuel CUELLA Fix the route-gateway option behavior. Signed-off-by: Samuel CUELLA ---- diff -Nur openvpn-git-orig/options.c openvpn-git/options.c --- openvpn-git-orig/options.c 2012-03-23 15:59:29.000000000 +0100 +++ openvpn-git/options.c 2012-03-23 17:29:33.000000000 +0100 @@ -5218,6 +5218,7 @@ else if (streq (p[0], "route-gateway") && p[1]) { VERIFY_PERMISSION (OPT_P_ROUTE_EXTRAS); + rol_check_alloc (options); if (streq (p[1], "dhcp")) { options->route_gateway_via_dhcp = true; @@ -5227,6 +5228,7 @@ if (ip_or_dns_addr_safe (p[1], options->allow_pull_fqdn) || is_special_addr (p[1])) /* FQDN -- may be DNS name */ { options->route_default_gateway = p[1]; + options->routes->flags |= (RG_ENABLE|RG_REROUTE_GW); } else {