diff --git a/src/peers.c b/src/peers.c index 659992cff..f5a4f1865 100644 --- a/src/peers.c +++ b/src/peers.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -475,7 +476,7 @@ static int peer_prepare_updatemsg(char *msg, size_t size, struct peer_prep_param cursor += stlen; } else if (st->table->type == SMP_T_SINT) { - netinteger = htonl(*((uint32_t *)ts->key.key)); + netinteger = htonl(read_u32(ts->key.key)); memcpy(cursor, &netinteger, sizeof(netinteger)); cursor += sizeof(netinteger); } diff --git a/src/stick_table.c b/src/stick_table.c index 9937f115f..665cc3768 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -3366,7 +3367,7 @@ static int table_dump_entry_to_buffer(struct buffer *msg, chunk_appendf(msg, " key=%s", addr); } else if (t->type == SMP_T_SINT) { - chunk_appendf(msg, " key=%u", *(unsigned int *)entry->key.key); + chunk_appendf(msg, " key=%u", read_u32(entry->key.key)); } else if (t->type == SMP_T_STR) { chunk_appendf(msg, " key=");