Skip to content

Commit ccdeb42

Browse files
jsharkeyAndroid (Google) Code Review
authored andcommitted
Merge "Avoid inconsistent state when remove fails." into ics-mr1
2 parents bc0b010 + 38ddeaa commit ccdeb42

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)