From bc7bf3c8611a3c393167d3ff7b292c145289dec8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 18 Feb 2019 10:33:38 +0100 Subject: [PATCH] platform/netlink: add nla_get_be64() helper --- src/platform/nm-netlink.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/platform/nm-netlink.h b/src/platform/nm-netlink.h index 840e56d8e4..d9ba93738e 100644 --- a/src/platform/nm-netlink.h +++ b/src/platform/nm-netlink.h @@ -211,6 +211,14 @@ nla_get_u64 (const struct nlattr *nla) return unaligned_read_ne64 (nla_data (nla)); } +static inline uint64_t +nla_get_be64 (const struct nlattr *nla) +{ + nm_assert (nla_len (nla) >= sizeof (uint64_t)); + + return unaligned_read_be64 (nla_data (nla)); +} + static inline char * nla_get_string (const struct nlattr *nla) {