Use uint_32 for UidOwnerMatchType
The enum is already using 12 bits, so using fewer bits loses information.
This is in sync with the UidOwnerValue struct used to contain this data.
Test: atest resolv_integration_test
Test: atest resolv_unit_test
Bug: 325150155
Change-Id: Ide0ccea9614cda803b3700a0cc22977e9608209e
diff --git a/tests/native/utilities/firewall.cpp b/tests/native/utilities/firewall.cpp
index 669b76a..718ec97 100644
--- a/tests/native/utilities/firewall.cpp
+++ b/tests/native/utilities/firewall.cpp
@@ -71,14 +71,14 @@
if (oldMatch.ok()) {
UidOwnerValue newMatch = {
.iif = iif ? iif : oldMatch.value().iif,
- .rule = static_cast<uint8_t>(oldMatch.value().rule | match),
+ .rule = static_cast<uint32_t>(oldMatch.value().rule | match),
};
auto res = mUidOwnerMap.writeValue(uid, newMatch, BPF_ANY);
if (!res.ok()) return Errorf("Failed to update rule: {}", res.error().message());
} else {
UidOwnerValue newMatch = {
.iif = iif,
- .rule = static_cast<uint8_t>(match),
+ .rule = static_cast<uint32_t>(match),
};
auto res = mUidOwnerMap.writeValue(uid, newMatch, BPF_ANY);
if (!res.ok()) return Errorf("Failed to add rule: {}", res.error().message());
@@ -93,7 +93,7 @@
UidOwnerValue newMatch = {
.iif = (match == IIF_MATCH) ? 0 : oldMatch.value().iif,
- .rule = static_cast<uint8_t>(oldMatch.value().rule & ~match),
+ .rule = static_cast<uint32_t>(oldMatch.value().rule & ~match),
};
if (newMatch.rule == 0) {
auto res = mUidOwnerMap.deleteValue(uid);