const struct ipset_attrname attr2name[],
struct nlattr *nla[])
{
+ uint64_t tmp;
uint32_t v;
int i;
attr2name[i].name, ntohl(v));
break;
case MNL_TYPE_U64:
+ memcpy(&tmp, mnl_attr_get_payload(nla[i]), sizeof(tmp));
fprintf(stderr, "\t\t%s: 0x%llx\n",
attr2name[i].name, (long long int)
- be64toh(*(uint64_t *)
- mnl_attr_get_payload(nla[i])));
+ be64toh(tmp));
break;
case MNL_TYPE_NUL_STRING:
fprintf(stderr, "\t\t%s: %s\n",
D("netorder attr type %u", type);
switch (attr->type) {
case MNL_TYPE_U64: {
- v64 = be64toh(*(const uint64_t *)d);
+ uint64_t tmp;
+ /* Ensure data alignment */
+ memcpy(&tmp, d, sizeof(tmp));
+ v64 = be64toh(tmp);
d = &v64;
break;
}