From de3e523ad6dc0704360aab31c4aa477ad0920c73 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 7 Nov 2015 11:30:18 +0100 Subject: header: add nla_get_le32() and nla_get_le64() These functions were added in commit c648a0138 "netlink: add nla_get for le32 and le64" Signed-off-by: Hauke Mehrtens --- backport/backport-include/net/netlink.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h index 35d9260f..40160b57 100644 --- a/backport/backport-include/net/netlink.h +++ b/backport/backport-include/net/netlink.h @@ -167,4 +167,26 @@ static inline struct in6_addr nla_get_in6_addr(const struct nlattr *nla) } #endif /* < 4.1 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) +/** + * nla_get_le32 - return payload of __le32 attribute + * @nla: __le32 netlink attribute + */ +#define nla_get_le32 LINUX_BACKPORT(nla_get_le32) +static inline __le32 nla_get_le32(const struct nlattr *nla) +{ + return *(__le32 *) nla_data(nla); +} + +/** + * nla_get_le64 - return payload of __le64 attribute + * @nla: __le64 netlink attribute + */ +#define nla_get_le64 LINUX_BACKPORT(nla_get_le64) +static inline __le64 nla_get_le64(const struct nlattr *nla) +{ + return *(__le64 *) nla_data(nla); +} +#endif /* < 4.4 */ + #endif /* __BACKPORT_NET_NETLINK_H */ -- cgit v1.2.3