mm-netlink: use unaligned netlink attribute length

Alignment padding is not accounted for in the netlink attribute
length.  Fix to avoid warnings later if we add shorter fixed
length attributes, even though it currently makes no difference
since we only add a 4 byte attribute

Signed-off-by: Bjørn Mork <bjorn@mork.no>
This commit is contained in:
Bjørn Mork
2022-03-28 13:00:20 +02:00
parent 7bbf6c8a4a
commit afd3ce86c9

View File

@@ -98,7 +98,7 @@ append_netlink_attribute (NetlinkMessage *msg,
memset ((char *) msg->data + old_len, 0, msg->len - old_len);
new_attr.rta_type = type;
new_attr.rta_len = attr_len;
new_attr.rta_len = RTA_LENGTH (len);
next_attr_abs_pos = (char *) msg->data + next_attr_rel_pos;
memcpy (next_attr_abs_pos, &new_attr, sizeof (struct rtattr));