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:
@@ -98,7 +98,7 @@ append_netlink_attribute (NetlinkMessage *msg,
|
|||||||
memset ((char *) msg->data + old_len, 0, msg->len - old_len);
|
memset ((char *) msg->data + old_len, 0, msg->len - old_len);
|
||||||
|
|
||||||
new_attr.rta_type = type;
|
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;
|
next_attr_abs_pos = (char *) msg->data + next_attr_rel_pos;
|
||||||
memcpy (next_attr_abs_pos, &new_attr, sizeof (struct rtattr));
|
memcpy (next_attr_abs_pos, &new_attr, sizeof (struct rtattr));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user