Skip to content

Commit

Permalink
Always use a 0.0.0.0/0 default on Android instead of def1 and do not …
Browse files Browse the repository at this point in the history
…try to delete routes

Signed-off-by: Arne Schwabe <[email protected]>
  • Loading branch information
schwabe committed Dec 4, 2024
1 parent 7052312 commit 700b8a7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/openvpn/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,17 @@ redirect_default_route_to_vpn(struct route_list *rl, const struct tuntap *tt,

if (rl->flags & RG_REROUTE_GW)
{
#ifdef TARGET_ANDROID
add_route3(0,
0,
rl->spec.remote_endpoint,
tt,
flags,
&rl->rgi,
es,
ctx);

#else /* ifdef TARGET_ANDROID */
if (rl->flags & RG_DEF1)
{
/* add new default route (1st component) */
Expand All @@ -1102,6 +1113,7 @@ redirect_default_route_to_vpn(struct route_list *rl, const struct tuntap *tt,
ret = add_route3(0, 0, rl->spec.remote_endpoint, tt,
flags, &rl->rgi, es, ctx) && ret;
}
#endif /* ifdef TARGET_ANDROID */
}

/* set a flag so we can undo later */
Expand Down

0 comments on commit 700b8a7

Please sign in to comment.