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

Commit 1b669231 authored by Chad Brubaker's avatar Chad Brubaker
Browse files

Include the interface for clearDnsInterfaceForUidRange

With netd allowing overlapping rules for uid range rules the interface
name is needed to make sure only the correct rule is removed.

Bug: 12134439
Change-Id: I94f77f154f49ca8d5f6cf49683a4473cc92c3eb7
parent 8e240af5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -420,7 +420,7 @@ interface INetworkManagementService
    /**
    * Clear a user range from being associated with an interface.
    */
    void clearDnsInterfaceForUidRange(int uid_start, int uid_end);
    void clearDnsInterfaceForUidRange(String iface, int uid_start, int uid_end);

    /**
    * Clear the mappings from pid to Dns interface and from uid range to Dns interface.
+1 −1
Original line number Diff line number Diff line
@@ -3898,7 +3898,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                boolean forwardDns) {
            try {
                mNetd.clearUidRangeRoute(interfaze, uidStart, uidEnd);
                if (forwardDns) mNetd.clearDnsInterfaceForUidRange(uidStart, uidEnd);
                if (forwardDns) mNetd.clearDnsInterfaceForUidRange(interfaze, uidStart, uidEnd);
            } catch (RemoteException e) {
            }

+2 −2
Original line number Diff line number Diff line
@@ -1567,10 +1567,10 @@ public class NetworkManagementService extends INetworkManagementService.Stub
    }

    @Override
    public void clearDnsInterfaceForUidRange(int uid_start, int uid_end) {
    public void clearDnsInterfaceForUidRange(String iface, int uid_start, int uid_end) {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
        try {
            mConnector.execute("resolver", "clearifaceforuidrange", uid_start, uid_end);
            mConnector.execute("resolver", "clearifaceforuidrange", iface, uid_start, uid_end);
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
        }