diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2015-11-07 11:30:18 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2015-11-07 17:12:09 +0100 |
commit | de3e523ad6dc0704360aab31c4aa477ad0920c73 (patch) | |
tree | 29332539d4c15e872222babfbe07568cea84fb59 | |
parent | b5ff57e6b70cafaf9e794213dc9c557f9abe73df (diff) |
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 <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/net/netlink.h | 22 |
1 files changed, 22 insertions, 0 deletions
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 */ |