Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78d51c22 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android (Google) Code Review
Browse files

Merge "Use the proper IpPrefix and LinkAddress constructors in VPN code." into lmp-mr1-dev

parents b443610b b2053114
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -501,7 +501,7 @@ public class VpnService extends Service {
                    }
                }
            }
            mRoutes.add(new RouteInfo(new LinkAddress(address, prefixLength), null));
            mRoutes.add(new RouteInfo(new IpPrefix(address, prefixLength), null));
            mConfig.updateAllowedFamilies(address);
            return this;
        }
+3 −6
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.net.IpPrefix;
import android.net.LinkAddress;
import android.net.Network;
import android.net.RouteInfo;
@@ -117,9 +118,7 @@ public class VpnConfig implements Parcelable {
        String[] routes = routesStr.trim().split(" ");
        for (String route : routes) {
            //each route is ip/prefix
            String[] split = route.split("/");
            RouteInfo info = new RouteInfo(new LinkAddress
                    (InetAddress.parseNumericAddress(split[0]), Integer.parseInt(split[1])), null);
            RouteInfo info = new RouteInfo(new IpPrefix(route), null);
            this.routes.add(info);
            updateAllowedFamilies(info.getDestination().getAddress());
        }
@@ -132,9 +131,7 @@ public class VpnConfig implements Parcelable {
        String[] addresses = addressesStr.trim().split(" ");
        for (String address : addresses) {
            //each address is ip/prefix
            String[] split = address.split("/");
            LinkAddress addr = new LinkAddress(InetAddress.parseNumericAddress(split[0]),
                    Integer.parseInt(split[1]));
            LinkAddress addr = new LinkAddress(address);
            this.addresses.add(addr);
            updateAllowedFamilies(addr.getAddress());
        }