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

Commit 3827353a authored by Hansen Kurli's avatar Hansen Kurli Committed by Automerger Merge Worker
Browse files

Remove findIPv4DefaultRoute am: 70770a8b am: 8ab55138

parents 46fcf7cd 8ab55138
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -2542,17 +2542,6 @@ public class Vpn {
    private native boolean jniAddAddress(String interfaze, String address, int prefixLen);
    private native boolean jniDelAddress(String interfaze, String address, int prefixLen);

    private static RouteInfo findIPv4DefaultRoute(LinkProperties prop) {
        for (RouteInfo route : prop.getAllRoutes()) {
            // Currently legacy VPN only works on IPv4.
            if (route.isDefaultRoute() && route.getGateway() instanceof Inet4Address) {
                return route;
            }
        }

        throw new IllegalStateException("Unable to find IPv4 default gateway");
    }

    private void enforceNotRestrictedUser() {
        final long token = Binder.clearCallingIdentity();
        try {
@@ -2651,10 +2640,6 @@ public class Vpn {
            throw new SecurityException("Restricted users cannot establish VPNs");
        }

        final RouteInfo ipv4DefaultRoute = findIPv4DefaultRoute(egress);
        final String gateway = ipv4DefaultRoute.getGateway().getHostAddress();
        final String iface = ipv4DefaultRoute.getInterface();

        // Load certificates.
        String privateKey = "";
        String userCert = "";