mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
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.
This commit is contained in:
parent
8b5075806d
commit
6cde5d883c
2 changed files with 4 additions and 2 deletions
|
|
@ -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 @@ 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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 @@ 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=");
|
||||
|
|
|
|||
Loading…
Reference in a new issue