[Openvpn-devel,v3] Always use a 0.0.0.0/0 default on Android instead of def1

Message ID 20261004100035.860-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v3] Always use a 0.0.0.0/0 default on Android instead of def1 |

Commit Message

Gert Doering Oct. 4, 2026, 10 a.m. UTC
  From: Arne Schwabe <arne@rfc2549.org>

Certain handset manufacturers (like Samsung iirc)  are handling
0.0.0.0/0 different from the split /1 routes, so push the 0.0.0.0/0
route to the OS.

Change-Id: I22e4b73e744c765a43bdb29f6e18813d103ea757
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/890
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/890
This mail reflects revision 3 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>
  

Comments

Gert Doering Oct. 4, 2026, 10:24 a.m. UTC | #1
I was reluctant on merging v1 because it added even more paths to 
"route.c", and we want this cleaned up instead ;-) - v3 is nicely
non-intrusive by just silently ignoring the "def1" flag 
#ifdef TARGET_ANDROID.

I *do* wonder if this is really still necessary on less-than-5-year-old
handsets, but then, Samsung, what do I know...  Arne is the one that gets
all the bug reports.

Your patch has been applied to the master branch.

commit cb0aa9691012e936da7a1099e6e3e746500e531e
Author: Arne Schwabe
Date:   Sun Oct 4 12:00:29 2026 +0200

     Always use a 0.0.0.0/0 default on Android instead of def1

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/890
     Message-Id: <20261004100035.860-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg39688.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index e3cd527..cbada6f 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -5615,7 +5615,14 @@ 
             }
             else if (streq(p[j], "def1"))
             {
+#ifndef TARGET_ANDROID
+                /* The hack that def1 uses to split 0.0.0.0 into 0.0.0.0/1 and
+                 * 128.0.0.0/1 is not needed on Android and will even
+                 * make some Android implementations (e.g. Samsung)
+                 * misbehave, so silently ignore the flag and always use
+                 * 0.0.0.0/0 instead */
                 options->routes->flags |= RG_DEF1;
+#endif
             }
             else if (streq(p[j], "bypass-dhcp"))
             {