summaryrefslogtreecommitdiff
path: root/lib/debug.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2015-10-28 17:13:31 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2015-10-28 17:13:31 +0100
commit0516924996e6ce0063ec682bc7b1c01db75af304 (patch)
tree40377a0c005d13b81230b81be9ac88e49c5be6bc /lib/debug.c
parent68afc6a7767d1af4aa5aae89e8dcfc036015c2f3 (diff)
downloadipset-0516924996e6ce0063ec682bc7b1c01db75af304.tar.gz
Handle uint64_t alignment issue in ipset tool
Diffstat (limited to 'lib/debug.c')
-rw-r--r--lib/debug.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/debug.c b/lib/debug.c
index b2c5003..6f831ec 100644
--- a/lib/debug.c
+++ b/lib/debug.c
@@ -77,6 +77,7 @@ debug_cadt_attrs(int max, const struct ipset_attr_policy *policy,
const struct ipset_attrname attr2name[],
struct nlattr *nla[])
{
+ uint64_t tmp;
uint32_t v;
int i;
@@ -102,10 +103,10 @@ debug_cadt_attrs(int max, const struct ipset_attr_policy *policy,
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",