diff options
| author | Lorenzo Colitti <lorenzo@google.com> | 2022-03-03 17:49:01 +0900 |
|---|---|---|
| committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | 2022-06-01 00:40:57 +0000 |
| commit | 90c0c3fd1a68f2538f28520805d0d92d331966f3 (patch) | |
| tree | 9b2014673dfec962eb88a0311a9f021ba67479f6 /service/native/TrafficControllerTest.cpp | |
| parent | edda01a74467368c7e34883a7358e531c48e45bc (diff) | |
Support more than 8 firewall chains / match types.
In the BPF code, per-UID network access (e.g., for doze mode,
standby, etc.) is stored in UidOwnerValue structures. Each of
these stores that UID's rules in a 32-bit bitmask of
UidOwnerMatchType values, so the code can support ~31 match
types.
However, which match types are enabled is stored in
configuration_map at index UID_RULES_CONFIGURATION_KEY, and
configuration_map only stores 8-bit values. So it's not
possible to define more than 7 match types.
Widen configuration_map to from 8 to 32 bits to match the width
of UidOwnerValue.rule. This doesn't impact memory because
configuration_map only has 2 entries.
Bug: 208371987
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e1eee2daedd66d27965a2dd4ce6b4c3667892f7
(cherry picked from commit 60cbed385dcf3c640674c48b7cd4d60967047cf0)
Merged-In: I7e1eee2daedd66d27965a2dd4ce6b4c3667892f7
Diffstat (limited to 'service/native/TrafficControllerTest.cpp')
| -rw-r--r-- | service/native/TrafficControllerTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/service/native/TrafficControllerTest.cpp b/service/native/TrafficControllerTest.cpp index ad53cb88bc..c44b9d6759 100644 --- a/service/native/TrafficControllerTest.cpp +++ b/service/native/TrafficControllerTest.cpp @@ -65,7 +65,7 @@ class TrafficControllerTest : public ::testing::Test { BpfMap<uint64_t, UidTagValue> mFakeCookieTagMap; BpfMap<uint32_t, StatsValue> mFakeAppUidStatsMap; BpfMap<StatsKey, StatsValue> mFakeStatsMapA; - BpfMap<uint32_t, uint8_t> mFakeConfigurationMap; + BpfMap<uint32_t, uint32_t> mFakeConfigurationMap; BpfMap<uint32_t, UidOwnerValue> mFakeUidOwnerMap; BpfMap<uint32_t, uint8_t> mFakeUidPermissionMap; |
