diff options
Diffstat (limited to 'src/expr/counter.c')
-rw-r--r-- | src/expr/counter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/expr/counter.c b/src/expr/counter.c index 2036cb0..a1f6574 100644 --- a/src/expr/counter.c +++ b/src/expr/counter.c @@ -35,10 +35,10 @@ nftnl_expr_counter_set(struct nftnl_expr *e, uint16_t type, switch(type) { case NFTNL_EXPR_CTR_BYTES: - ctr->bytes = *((uint64_t *)data); + memcpy(&ctr->bytes, data, sizeof(ctr->bytes)); break; case NFTNL_EXPR_CTR_PACKETS: - ctr->pkts = *((uint64_t *)data); + memcpy(&ctr->pkts, data, sizeof(ctr->pkts)); break; default: return -1; |