Signed-off-by: Felix Fietkau <nbd@openwrt.org>
static inline uint64_t
blob_get_u64(const struct blob_attr *attr)
{
- uint64_t *tmp = (uint64_t*)attr->data;
- return be64_to_cpu(*tmp);
+ uint32_t *ptr = blob_data(attr);
+ uint64_t tmp = ((uint64_t) be32_to_cpu(ptr[0])) << 32;
+ tmp |= be32_to_cpu(ptr[1]);
+ return tmp;
}
static inline int8_t
static inline uint64_t blobmsg_get_u64(struct blob_attr *attr)
{
- return be64_to_cpu(*(uint64_t *) blobmsg_data(attr));
+ uint32_t *ptr = blobmsg_data(attr);
+ uint64_t tmp = ((uint64_t) be32_to_cpu(ptr[0])) << 32;
+ tmp |= be32_to_cpu(ptr[1]);
+ return tmp;
}
static inline char *blobmsg_get_string(struct blob_attr *attr)