Correct generic netlink command payload buffer size calculations by aligning against the size of the attribute (e.g. sizeof(uint16_t)) as expected instead of size of the attribute size (e.g. sizeof(sizeof(uint16_t))).
Payload buffer sizes should now be smaller in some cases since netlink attributes are aligned on a 4 byte boundary. For example, the underlying NLA_ALIGN() macro returns 4 when the type is uint16_t, i.e. NLA_ALIGN(sizeof(uint16_t)). Previously, 8 was returned on 64 bit platforms since the NLA_ALIGN() call was incorrectly called as NLA_ALIGN(sizeof(sizeof(uint16_t))), which boils downs to NLA_ALIGN(size_t).
Correct generic netlink command payload buffer size calculations by aligning against the size of the attribute (e.g.
sizeof(uint16_t)
) as expected instead of size of the attribute size (e.g.sizeof(sizeof(uint16_t))
).Payload buffer sizes should now be smaller in some cases since netlink attributes are aligned on a 4 byte boundary. For example, the underlying
NLA_ALIGN()
macro returns4
when the type isuint16_t
, i.e.NLA_ALIGN(sizeof(uint16_t))
. Previously,8
was returned on 64 bit platforms since theNLA_ALIGN()
call was incorrectly called asNLA_ALIGN(sizeof(sizeof(uint16_t)))
, which boils downs toNLA_ALIGN(size_t)
.