Do not enable ingress rate limit until clsact qdisc exists
The tc police filter attaches to the clsact qdisc, so the rate limit cannot be enabled before the qdisc is added to the interface. The clsact qdisc is added as part of INetd#networkAddInterface, which is called from inside updateLinkProperties. Test: atest FrameworksNetTests:ConnectivityServiceTest Change-Id: I0713605ff3684f8271eb3f0e29ab7116561963f1
This commit is contained in:
@@ -1998,6 +1998,13 @@ public class ConnectivityServiceTest {
|
||||
// updated. Check that this happened.
|
||||
assertEquals(-1L, (long) mActiveRateLimit.getOrDefault(iface, -1L));
|
||||
mActiveRateLimit.put(iface, rateInBytesPerSecond);
|
||||
// verify that clsact qdisc has already been created, otherwise attaching a tc police
|
||||
// filter will fail.
|
||||
try {
|
||||
verify(mMockNetd).networkAddInterface(anyInt(), eq(iface));
|
||||
} catch (RemoteException e) {
|
||||
fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user