diff options
author | Arne Schwabe <arne@rfc2549.org> | 2014-08-14 22:57:06 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2014-08-14 22:57:06 +0200 |
commit | f228daf2285886ac3981f48228e2728af37af4bb (patch) | |
tree | 21f79e3f2839022b3c9a3b2e7cfcaa4cf6300363 /main/src | |
parent | 86a8419dab60b106208210bdcda67e988efe02f1 (diff) |
Add workaround for Android bug #70916
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java index 09a2d91e..c55d5b0d 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java @@ -495,8 +495,15 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac } } - - builder.setMtu(mMtu); + String release = Build.VERSION.RELEASE; + if ((Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT && !release.startsWith("4.4.3") + && !release.startsWith("4.4.4") && !release.startsWith("4.4.5") && !release.startsWith("4.4.6")) + && mMtu < 1280) { + VpnStatus.logInfo(String.format("Forcing MTU to 1280 instead of %d to workaround Android Bug #70916", mMtu)); + builder.setMtu(1280); + } else { + builder.setMtu(mMtu); + } Collection<ipAddress> positiveIPv4Routes = mRoutes.getPositiveIPList(); Collection<ipAddress> positiveIPv6Routes = mRoutesv6.getPositiveIPList(); |