All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Kupreychik <foxel@quickfox.ru>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: wireguard@lists.zx2c4.com
Subject: Re: Bug report: WireGuard client not setting underlying network on Android Pie
Date: Thu, 23 Jan 2020 13:47:28 +0700	[thread overview]
Message-ID: <CA+hAYVnPDw_t9dRm8CEZeF+iDXQyPAGosfzLCQiY+izF9jMNag@mail.gmail.com> (raw)
In-Reply-To: <aaf2a265-f53e-f6d2-09d7-e83497578a81@zx2c4.com>


[-- Attachment #1.1: Type: text/plain, Size: 3136 bytes --]

Hi.

I'm not good enough in Android development to say for sure. I found a
similar bud fixed different ways:
OpenVPN:
https://github.com/schwabe/ics-openvpn/blob/450e99c135ebabbf911d6880e39811d88454cdd1/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java#L877
Outline:
https://github.com/Jigsaw-Code/outline-client/commit/3a9dad6a3cbe962cb10e443cfea21c929e98ef32

Since OpenVPN uses the same I suppose it should help. But looks like it
should still be wrapped with an Android version check.

чт, 16 янв. 2020 г. в 01:29, Jason A. Donenfeld <Jason@zx2c4.com>:

> Hi Andrey,
>
> Thanks for the bug report.
>
> On 1/13/20 12:00 AM, Andrey Kupreychik wrote:
> > My Android phone running wireguard VPN threats it as a metered
> > connection and does not do anything it should do on Wi-Fi only
> >
> > What I found is this discussion
> > https://issuetracker.google.com/issues/114309459
> > I've looked thru the GitHub mirror code and found no evidance of
> > setUnderlyingNetworks called in WireGuard client code.
> >
> > As seen in the issue tracker link above, it's needed in order to take
> > advantage of this
> > (
> https://developer.android.com/about/versions/pie/android-9.0-changes-all#network-capabilities-vpn)
>
> > behavior change. As described in the issue tracker link, this prevents
> > Pie devices from properly using unmetered WiFi networks.
>
> Are you suggesting something like the below? According to the docs, the
> null value is the "default", and the others don't fit the wireguard
> model. Are you saying we should still be calling this anyway because the
> android system is expecting it?
>
>  From 4ae0e9688e4edfdad06e6db49f414a95c5663d07 Mon Sep 17 00:00:00 2001
> From: "Jason A. Donenfeld" <Jason@zx2c4.com>
> Date: Wed, 15 Jan 2020 13:25:56 -0500
> Subject: [PATCH] GoBackend: set empty underlying networks
>
> https://lists.zx2c4.com/pipermail/wireguard/2020-January/004859.html
> https://issuetracker.google.com/issues/114309459
>
> https://developer.android.com/about/versions/pie/android-9.0-changes-all#network-capabilities-vpn
>
> Apparently we need to call this at least once.
>
> Reported-by: Andrey Kupreychik <foxel@quickfox.ru>
> ---
>   app/src/main/java/com/wireguard/android/backend/GoBackend.java | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git
> a/app/src/main/java/com/wireguard/android/backend/GoBackend.java
> b/app/src/main/java/com/wireguard/android/backend/GoBackend.java
> index 3e8e1ec..3c4c893 100644
> --- a/app/src/main/java/com/wireguard/android/backend/GoBackend.java
> +++ b/app/src/main/java/com/wireguard/android/backend/GoBackend.java
> @@ -224,6 +224,7 @@ public final class GoBackend implements Backend {
>
>               currentTunnel = tunnel;
>
> +            service.setUnderlyingNetworks(null);
>               service.protect(wgGetSocketV4(currentTunnelHandle));
>               service.protect(wgGetSocketV6(currentTunnelHandle));
>           } else {
> --
> 2.24.1
>
>
> Regards,
> Jason
>


-- 
Andrey Kupreychik <foxel@quickfox.ru>
http://foxel.quickfox.ru

[-- Attachment #1.2: Type: text/html, Size: 4918 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

  reply	other threads:[~2020-01-30  1:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13  5:00 Bug report: WireGuard client not setting underlying network on Android Pie Andrey Kupreychik
2020-01-15 18:29 ` Jason A. Donenfeld
2020-01-23  6:47   ` Andrey Kupreychik [this message]
2020-01-23 12:49     ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+hAYVnPDw_t9dRm8CEZeF+iDXQyPAGosfzLCQiY+izF9jMNag@mail.gmail.com \
    --to=foxel@quickfox.ru \
    --cc=Jason@zx2c4.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.