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/session.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/session.c') diff --git a/lib/session.c b/lib/session.c index 95c253e..24f29f5 100644 --- a/lib/session.c +++ b/lib/session.c @@ -636,7 +636,10 @@ attr2data(struct ipset_session *session, struct nlattr *nla[], 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; } -- cgit v1.2.3