summaryrefslogtreecommitdiffstats
path: root/lib/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/session.c')
-rw-r--r--lib/session.c5
1 files changed, 4 insertions, 1 deletions
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;
}