0
0
mirror of https://github.com/schwabe/ics-openvpn.git synced 2024-09-20 20:03:13 +02:00

Ignore multicast routes when adding routes, at least Lollipop does not like them.

--HG--
extra : source : 7601bdd8dce43eb44d6b2ad8fda03f8539fc50e0
This commit is contained in:
Arne Schwabe 2015-01-09 15:55:25 +01:00
parent 3b11c7515a
commit 3c7cb13eca
3 changed files with 11 additions and 3 deletions

View File

@ -172,8 +172,9 @@ public class NetworkSpace {
}
public boolean containsNet(ipAddress network) {
return getFirstAddress().compareTo(network.getFirstAddress()) != 1 &&
getLastAddress().compareTo(network.getLastAddress()) != -1;
// this.first >= net.first && this.last <= net.last
return getFirstAddress().compareTo(network.getFirstAddress()) != -1 &&
getLastAddress().compareTo(network.getLastAddress()) != 1;
}
}

View File

@ -551,9 +551,15 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
Collection<ipAddress> positiveIPv4Routes = mRoutes.getPositiveIPList();
Collection<ipAddress> positiveIPv6Routes = mRoutesv6.getPositiveIPList();
ipAddress multicastRange = new ipAddress(new CIDRIP("224.0.0.0", 3), true);
for (NetworkSpace.ipAddress route : positiveIPv4Routes) {
try {
builder.addRoute(route.getIPv4Address(), route.networkMask);
if (multicastRange.containsNet(route))
VpnStatus.logDebug(R.string.ignore_multicast_route, route.toString());
else
builder.addRoute(route.getIPv4Address(), route.networkMask);
} catch (IllegalArgumentException ia) {
VpnStatus.logError(getString(R.string.route_rejected) + route + " " + ia.getLocalizedMessage());
}

View File

@ -350,5 +350,6 @@
<string name="show_log">Show log</string>
<string name="faq_android_clients">Multiple OpenVPN clients for Android exist. The most common ones are OpenVPN for Android (this client), OpenVPN Connect and OpenVPN Settings.&lt;p&gt;The clients can be grouped into two groups: OpenVPN for Android and OpenVPN Connect use the official VPNService API (Android 4.0+) and require no root and OpenVPN Settings which uses root.&lt;p&gt;OpenVPN for Android is an open source client and developed by Arne Schwabe. It is targeted at more advanced users and offers many settings and the ability to import profiles from files and to configure/change profiles inside the app. The client is based on the community version of OpenVPN. It is based on the OpenVPN 2.x source code. This client can be seen as the semi officially client of the community. &lt;p&gt;OpenVPN Connect is non open source client that is developed by OpenVPN Technologies, Inc. The client is indented to be general use client and moree targeted at the average user and allows the import of OpenVPN profiles. This client is based on the OpenVPN C++ reimplementation of the OpenVPN protocol (This was required to allow OpenVPN Technologies, Inc to publish an iOS OpenVPN app). This client is the official client of the OpenVPN technologies &lt;p&gt; OpenVPN Settings is the oldest of the clients and also a UI for the open source OpenVPN. In contrast to OpenVPN for Android it requires root and does not use the VPNService API. It does not depend on Android 4.0+</string>
<string name="faq_androids_clients_title">Differences between the OpenVPN Android clients</string>
<string name="ignore_multicast_route">Ignoring multicast route: %s</string>
</resources>