CLEANUP: stick-tables: use read_u32() to display a node's key
This fixes another aliasing issue that pops up in stick_table.c
and peers.c's debug code.
diff --git a/src/peers.c b/src/peers.c
index 659992c..f5a4f18 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -22,6 +22,7 @@
#include <common/compat.h>
#include <common/config.h>
+#include <common/net_helper.h>
#include <common/time.h>
#include <common/standard.h>
#include <common/hathreads.h>
@@ -475,7 +476,7 @@
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 9937f11..665cc37 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -19,6 +19,7 @@
#include <common/initcall.h>
#include <common/memory.h>
#include <common/mini-clist.h>
+#include <common/net_helper.h>
#include <common/standard.h>
#include <common/time.h>
@@ -3366,7 +3367,7 @@
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=");