@@ -102,6 +102,7 @@ print_bypass_addresses(const struct route_bypass *rb)
102102#define RTA_SUCCESS 1 /* route addition succeeded */
103103#define RTA_EEXIST 2 /* route not added as it already exists */
104104
105+ #ifndef TARGET_ANDROID
105106static bool
106107add_bypass_address (struct route_bypass * rb , const in_addr_t a )
107108{
@@ -123,6 +124,7 @@ add_bypass_address(struct route_bypass *rb, const in_addr_t a)
123124 return false;
124125 }
125126}
127+ #endif
126128
127129struct route_option_list *
128130new_route_option_list (struct gc_arena * a )
@@ -2035,9 +2037,7 @@ delete_route(struct route_ipv4 *r, const struct tuntap *tt, unsigned int flags,
20352037#if !defined(TARGET_AIX )
20362038 const char * netmask ;
20372039#endif
2038- #if !defined(TARGET_ANDROID )
20392040 const char * gateway ;
2040- #endif
20412041#else /* if !defined(TARGET_LINUX) */
20422042 int metric ;
20432043#endif
@@ -2056,9 +2056,7 @@ delete_route(struct route_ipv4 *r, const struct tuntap *tt, unsigned int flags,
20562056#if !defined(TARGET_AIX )
20572057 netmask = print_in_addr_t (r -> netmask , 0 , & gc );
20582058#endif
2059- #if !defined(TARGET_ANDROID )
20602059 gateway = print_in_addr_t (r -> gateway , 0 , & gc );
2061- #endif
20622060#endif
20632061
20642062 is_local_route = local_route (r -> network , r -> netmask , r -> gateway , rgi );
@@ -2165,9 +2163,13 @@ delete_route(struct route_ipv4 *r, const struct tuntap *tt, unsigned int flags,
21652163 openvpn_execve_check (& argv , es , 0 , "ERROR: OpenBSD/NetBSD route delete command failed" );
21662164
21672165#elif defined(TARGET_ANDROID )
2166+ /* Avoids the unused variables warnings that all other platforms use
2167+ * by adding them to the error message. */
21682168 msg (D_ROUTE_DEBUG , "Deleting routes on Android is not possible/not "
21692169 "needed. The VpnService API allows routes to be set "
2170- "on connect only and will clean up automatically." );
2170+ "on connect only and will clean up automatically. "
2171+ "Tried to delete route %s netmask %s gateway %s" ,
2172+ network , netmask , gateway );
21712173#elif defined(TARGET_AIX )
21722174
21732175 {
@@ -2349,7 +2351,10 @@ delete_route_ipv6(const struct route_ipv6 *r6, const struct tuntap *tt, const st
23492351#elif defined(TARGET_ANDROID )
23502352 msg (D_ROUTE_DEBUG , "Deleting routes on Android is not possible/not "
23512353 "needed. The VpnService API allows routes to be set "
2352- "on connect only and will clean up automatically." );
2354+ "on connect only and will clean up automatically. "
2355+ "Tried to delete %s gateway %s" ,
2356+ network ,
2357+ gateway_needed ? gateway : "(not needed)" );
23532358#elif defined(TARGET_HAIKU )
23542359
23552360 /* ex: route delete /dev/net/ipro1000/0 inet6 :: gw beef::cafe prefixlen 64 */
0 commit comments