diff options
| author | Michael Biebl <biebl@debian.org> | 2023-03-09 20:01:53 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2023-03-09 20:01:53 +0100 |
| commit | cffb548b401e2cd3fad166aa92e0f634bbb1d4d6 (patch) | |
| tree | 6d803d8f7d0d92a1c5e5705974fff8975472af95 /src/libnm-platform/nm-netlink.c | |
| parent | 647d6b95d5475e0a1bf3d6f299d1cb8c9041a7a4 (diff) | |
| parent | 12e1ee797bbf0b10d1fd5afd4b947484769f2b9f (diff) | |
Merge tag 'debian/1.42.4-1' into debian/bullseye-backports
network-manager Debian release 1.42.4-1
Diffstat (limited to 'src/libnm-platform/nm-netlink.c')
| -rw-r--r-- | src/libnm-platform/nm-netlink.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libnm-platform/nm-netlink.c b/src/libnm-platform/nm-netlink.c index e08eee5e..fc704226 100644 --- a/src/libnm-platform/nm-netlink.c +++ b/src/libnm-platform/nm-netlink.c @@ -325,7 +325,8 @@ nlmsg_parse_error(const struct nlmsghdr *nlh, const char **out_extack_msg) struct nlattr *tb[G_N_ELEMENTS(policy)]; struct nlattr *tlvs; - tlvs = (struct nlattr *) ((char *) e + sizeof(*e) + e->msg.nlmsg_len - NLMSG_HDRLEN); + tlvs = NM_CAST_ALIGN(struct nlattr, + (((char *) e) + sizeof(*e) + e->msg.nlmsg_len - NLMSG_HDRLEN)); if (nla_parse_arr(tb, tlvs, nlh->nlmsg_len - sizeof(*e) - e->msg.nlmsg_len, policy) >= 0) { if (tb[NLMSGERR_ATTR_MSG]) *out_extack_msg = nla_get_string(tb[NLMSGERR_ATTR_MSG]); @@ -842,7 +843,7 @@ genlmsg_len(const struct genlmsghdr *gnlh) { const struct nlmsghdr *nlh; - nlh = (const struct nlmsghdr *) ((const unsigned char *) gnlh - NLMSG_HDRLEN); + nlh = NM_CAST_ALIGN(const struct nlmsghdr, (((char *) gnlh) - NLMSG_HDRLEN)); return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN); } @@ -1253,7 +1254,7 @@ continue_reading: if (n <= 0) return n; - hdr = (struct nlmsghdr *) buf; + hdr = NM_CAST_ALIGN(struct nlmsghdr, buf); while (nlmsg_ok(hdr, n)) { nm_auto_nlmsg struct nl_msg *msg = NULL; |