Tweak RTA_METRICS size calculation.
Use the more correct RTA_SPACE macro instead of manually
calculating the size, and the more appropriate size_t type
instead of int.
Bug: 142892223
Test: covered by existing unit tests
Change-Id: I74dd5c912e2a13721e1bd6c90df4a579e826805f
diff --git a/server/RouteController.cpp b/server/RouteController.cpp
index c4c3cfb..c2163cd 100644
--- a/server/RouteController.cpp
+++ b/server/RouteController.cpp
@@ -120,9 +120,10 @@
// One or more nested attributes in the RTA_METRICS attribute.
rtattr RTATTRX_MTU = { U16_RTA_LENGTH(sizeof(uint32_t)), RTAX_MTU};
+constexpr size_t RTATTRX_MTU_SIZE = RTA_SPACE(sizeof(uint32_t));
// The RTA_METRICS attribute itself.
-constexpr int RTATTR_METRICS_SIZE = sizeof(RTATTRX_MTU) + sizeof(uint32_t);
+constexpr size_t RTATTR_METRICS_SIZE = RTATTRX_MTU_SIZE;
rtattr RTATTR_METRICS = { U16_RTA_LENGTH(RTATTR_METRICS_SIZE), RTA_METRICS };
uint8_t PADDING_BUFFER[RTA_ALIGNTO] = {0, 0, 0, 0};