From afd3ce86c9c6801cd245e943c171fe2de20c9d7b Mon Sep 17 00:00:00 2001 From: Bjørn Mork Date: Mon, 28 Mar 2022 13:00:20 +0200 Subject: mm-netlink: use unaligned netlink attribute length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/mm-netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mm-netlink.c') diff --git a/src/mm-netlink.c b/src/mm-netlink.c index 40b108d1..c54942be 100644 --- a/src/mm-netlink.c +++ b/src/mm-netlink.c @@ -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)); -- cgit v1.2.3-70-g09d2