Skip to content

Commit 38ddeaa

Browse files
committed
Avoid inconsistent state when remove fails.
Bug: 5433432 Change-Id: Ia388fda006cbda09b5947fc61cec6353f75a3805
1 parent 6dee1a9 commit 38ddeaa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

services/java/com/android/server/NetworkManagementService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,12 +1136,14 @@ public void removeInterfaceQuota(String iface) {
11361136
final StringBuilder command = new StringBuilder();
11371137
command.append("bandwidth removeiquota ").append(iface);
11381138

1139+
mActiveQuotaIfaces.remove(iface);
1140+
mActiveAlertIfaces.remove(iface);
1141+
11391142
try {
11401143
// TODO: support quota shared across interfaces
11411144
mConnector.doCommand(command.toString());
1142-
mActiveQuotaIfaces.remove(iface);
1143-
mActiveAlertIfaces.remove(iface);
11441145
} catch (NativeDaemonConnectorException e) {
1146+
// TODO: include current iptables state
11451147
throw new IllegalStateException("Error communicating to native daemon", e);
11461148
}
11471149
}

0 commit comments

Comments
 (0)