Hi,

On Fri, Oct 02, 2020 at 03:26:29PM +0200, François Kooman wrote:
> The log shows this "NOTE": 2020-10-02 06:20:07 NOTE: unable to redirect 
> IPv4 default gateway -- Cannot obtain current remote host address

I have a patch for that one already, which is fairly obvious:

diff --git a/src/openvpn/route.c b/src/openvpn/route.c
index d75aa5f4..490d6d51 100644
--- a/src/openvpn/route.c
+++ b/src/openvpn/route.c
@@ -1015,10 +1015,6 @@ redirect_default_route_to_vpn(struct route_list *rl, 
const struct tuntap *tt,
         {
             msg(M_WARN, "%s Cannot read current default gateway from system", 
err);
         }
-        else if (!(rl->spec.flags & RTSA_REMOTE_HOST))
-        {
-            msg(M_WARN, "%s Cannot obtain current remote host address", err);
-        }
         else
         {
 #ifndef TARGET_ANDROID
@@ -1041,7 +1037,8 @@ redirect_default_route_to_vpn(struct route_list *rl, 
const struct tuntap *tt,
                 /* route remote host to original default gateway */
                 /* if remote_host is not ipv4 (ie: ipv6), just skip
                  * adding this special /32 route */
-                if (rl->spec.remote_host != IPV4_INVALID_ADDR)
+                if ((rl->spec.flags & RTSA_REMOTE_HOST)
+                    && rl->spec.remote_host != IPV4_INVALID_ADDR)
                 {
                     add_route3(rl->spec.remote_host,
                                IPV4_NETMASK_HOST,


... but it's incomplete, as the "if there is no ipv4 gateway at all"
case is also broken (Thomas Schäfer reported this).

This is just a HEADS UP ("I am working on it, and if you want, you can
comment on the solution I found"), a proper patch will follow tonight.

gert
-- 
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             g...@greenie.muc.de

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to