]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix --redirect-private in --dev tap mode.
authorGuy Yur <guyyur@gmail.com>
Mon, 1 Jun 2015 19:51:13 +0000 (21:51 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 1 Jun 2015 19:55:34 +0000 (21:55 +0200)
When specifying redirect-private option and not specifying route-gateway
or ifconfig options, OpenVPN fails to add the route to the remote host
with the following message:

NOTE: unable to redirect default gateway -- VPN gateway parameter
(--route-gateway or --ifconfig) is missing

In redirect_default_route_to_vpn() the check for remote endpoint happens
even though it is not used by redirect-private - make check conditional
on RG_REROUTE_GW (= --redirect-gateway).

Trac #261

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20150531120327.GE382@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9761
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/route.c

index a349ac9808cbf2eb6e21f8b4a45cfe33e08c00b4..ee7c0def89b38fbcf808e9a85a45d1ca3882d5a8 100644 (file)
@@ -808,7 +808,7 @@ redirect_default_route_to_vpn (struct route_list *rl, const struct tuntap *tt, u
 
   if ( rl && rl->flags & RG_ENABLE )
     {
-      if (!(rl->spec.flags & RTSA_REMOTE_ENDPOINT))
+      if (!(rl->spec.flags & RTSA_REMOTE_ENDPOINT) && (rl->flags & RG_REROUTE_GW))
        {
          msg (M_WARN, "%s VPN gateway parameter (--route-gateway or --ifconfig) is missing", err);
        }