From 0516924996e6ce0063ec682bc7b1c01db75af304 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Wed, 28 Oct 2015 17:13:31 +0100 Subject: Handle uint64_t alignment issue in ipset tool --- lib/debug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/debug.c') 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", -- cgit v1.2.3