diff options
| author | Michael Biebl <biebl@debian.org> | 2023-02-10 11:50:34 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2023-02-10 11:50:34 +0100 |
| commit | 1372848511cb896b80b51ed1a3e9606bd9816631 (patch) | |
| tree | 674792b9385bdef935988894b45f06b2af39f88c /src/libnm-platform/nm-netlink.h | |
| parent | 40ec077ea305994c1fc2130add6787ca0c73e2c6 (diff) | |
New upstream version 1.42.0 upstream/1.42.0
Diffstat (limited to 'src/libnm-platform/nm-netlink.h')
| -rw-r--r-- | src/libnm-platform/nm-netlink.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libnm-platform/nm-netlink.h b/src/libnm-platform/nm-netlink.h index 634be2b4..cdb8a81c 100644 --- a/src/libnm-platform/nm-netlink.h +++ b/src/libnm-platform/nm-netlink.h @@ -340,7 +340,7 @@ nla_next(const struct nlattr *nla, int *remaining) int totlen = NLA_ALIGN(nla->nla_len); *remaining -= totlen; - return (struct nlattr *) ((char *) nla + totlen); + return NM_CAST_ALIGN(struct nlattr, (((char *) nla) + totlen)); } #define nla_for_each_attr(pos, head, len, rem) \ @@ -434,7 +434,7 @@ nlmsg_next(struct nlmsghdr *nlh, int *remaining) *remaining -= totlen; - return (struct nlmsghdr *) ((unsigned char *) nlh + totlen); + return NM_CAST_ALIGN(struct nlmsghdr, (((char *) nlh) + totlen)); } int nlmsg_get_proto(struct nl_msg *msg); @@ -493,8 +493,9 @@ nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen) static inline struct nlattr * nlmsg_attrdata(const struct nlmsghdr *nlh, int hdrlen) { - unsigned char *data = nlmsg_data(nlh); - return (struct nlattr *) (data + NLMSG_ALIGN(hdrlen)); + char *data = nlmsg_data(nlh); + + return NM_CAST_ALIGN(struct nlattr, (data + NLMSG_ALIGN(hdrlen))); } static inline struct nlattr * |