[Openvpn-devel] Always use a 0.0.0.0/0 default on Android instead of def1 and do not try to delete routes

Message ID 20181005130442.32075-1-arne@rfc2549.org
State New
Headers show
Series
  • [Openvpn-devel] Always use a 0.0.0.0/0 default on Android instead of def1 and do not try to delete routes
Related show

Commit Message

Arne Schwabe Oct. 5, 2018, 1:04 p.m.
---
 src/openvpn/route.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Patch

diff --git a/src/openvpn/route.c b/src/openvpn/route.c
index ff392308..cadd34e1 100644
--- a/src/openvpn/route.c
+++ b/src/openvpn/route.c
@@ -1050,6 +1050,16 @@  redirect_default_route_to_vpn(struct route_list *rl, const struct tuntap *tt, un
 
             if (rl->flags & RG_REROUTE_GW)
             {
+#ifdef TARGET_ANDROID
+                add_route3 (0,
+                            0,
+                            rl->spec.remote_endpoint,
+                            tt,
+                            flags,
+                            &rl->rgi,
+                            es);
+
+#else
                 if (rl->flags & RG_DEF1)
                 {
                     /* add new default route (1st component) */
@@ -1089,6 +1099,7 @@  redirect_default_route_to_vpn(struct route_list *rl, const struct tuntap *tt, un
                                &rl->rgi,
                                es);
                 }
+#endif
             }
 
             /* set a flag so we can undo later */