multipath-tcp / mptcpd

mptcpd is a daemon for Linux that performs Multipath TCP path management related operations in the user space 😈
https://mptcpd.mptcp.dev/
BSD 3-Clause "New" or "Revised" License
169 stars 36 forks source link

src: Fix genl command payload size calculations. #269

Closed ossama-othman closed 1 year ago

ossama-othman commented 1 year ago

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).

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 3390929654

Details


Files with Coverage Reduction New Missed Lines %
src/netlink_pm_upstream.c 51 73.16%
<!-- Total: 51 -->
Totals Coverage Status
Change from base Build 3086411145: 0.03%
Covered Lines: 1395
Relevant Lines: 2146

💛 - Coveralls