Ignore Ipv6 route delete request on Android and set ipv4 verbosity to 7
PATCH 1/1 Ignore Ipv6 route delete request on Android and set ipv4 verbosity to 7
Android has no facility nor need one to delete routes as routes are automatically cleaned up when the tun interface is closed. Also adjust the IPv4 message to be only shown and verb 7 and rephrase the message.
--- src/openvpn/route.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
src/openvpn/route.c +7 -3
@@ -2302,8 +2302,9 @@ delete_route(struct route_ipv4 *r,openvpn_execve_check (&argv, es,0 ,"ERROR: OpenBSD/NetBSD route delete command failed" );#elif defined(TARGET_ANDROID ) -msg (M_NONFATAL ,"Sorry, deleting routes on Android is not possible. The VpnService API allows routes to be set on connect only." ); - +msg (D_ROUTE_DEBUG ,"Deleting routes on Android is not possible/not " +"needed. The VpnService API allows routes to be set " +"on connect only and will clean up automatically." );#elif defined(TARGET_AIX ) {
@@ -2490,7 +2491,10 @@ delete_route_ipv6(const struct route_ipv6 *r6, const struct tuntap *tt, network, r6->netbits, gateway);argv_msg (D_ROUTE , &argv);openvpn_execve_check (&argv, es,0 ,"ERROR: AIX route add command failed" ); - +#elif defined(TARGET_ANDROID ) +msg (D_ROUTE_DEBUG ,"Deleting routes on Android is not possible/not " +"needed. The VpnService API allows routes to be set " +"on connect only and will clean up automatically." );#else /* if defined(TARGET_LINUX) */ msg (M_FATAL ,"Sorry, but I don't know how to do 'route ipv6' commands on this operating system. Try putting your routes in a --route-down script" );#endif /* if defined(TARGET_LINUX) */
Signature · 1 line
2.39.2 (Apple Git-143)
"because it makes sense"
Not tested beyond stare-at-code and have GHA do a test build, because this is all #ifdef TARGET_ANDROID, and "only msg() calls" at that.
Uncrustify complains about indentation, so whitespace adjusted accordingly.
Your patch has been applied to the master and release/2.6 branch (one could argue that branch, but it's "fix a misleading error message" so it qualifies as a mini bugfix). Not applying to 2.5 or 2.4 :-)
commit ab01eaf49fa9341ff647206bd6e3017770cc0674 (master) commit 4ed7d7f72515c7df34edf617cb0bb8f2ac533e48 (release/2.6)
Author: Arne Schwabe Date: Wed Jul 12 11:46:20 2023 +0200
Ignore Ipv6 route delete request on Android and set ipv4 verbosity to 7
Signed-off-by: Arne Schwabe <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26848.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering