From f228daf2285886ac3981f48228e2728af37af4bb Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 14 Aug 2014 22:57:06 +0200 Subject: Add workaround for Android bug #70916 --- main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'main/src') 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 positiveIPv4Routes = mRoutes.getPositiveIPList(); Collection positiveIPv6Routes = mRoutesv6.getPositiveIPList(); -- cgit v1.2.3