mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-05 19:10:45 +00:00
BUG/MEDIUM: peers: fix key consistency for integer stick tables
Peers with integer stick tables are breaking the keys received. This is due to the fact that the sender converts the key with htonl() but the receiver doesn't convert the value back to its original format. Peers appeared in haproxy-1.5, no backport is needed.
This commit is contained in:
parent
84310e2e73
commit
9a60ff9cb6
@ -676,10 +676,14 @@ switchstate:
|
||||
}
|
||||
}
|
||||
else if (ps->table->table->type == STKTABLE_TYPE_INTEGER) {
|
||||
newts = stksess_new(ps->table->table, NULL);
|
||||
reql = bo_getblk(si->ob, newts ? (char *)newts->key.key : trash.str, sizeof(netinteger), totl);
|
||||
reql = bo_getblk(si->ob, (char *)&netinteger, sizeof(netinteger), totl);
|
||||
if (reql <= 0) /* closed or EOL not found */
|
||||
goto incomplete;
|
||||
newts = stksess_new(ps->table->table, NULL);
|
||||
if (newts) {
|
||||
netinteger = ntohl(netinteger);
|
||||
memcpy(newts->key.key, &netinteger, sizeof(netinteger));
|
||||
}
|
||||
totl += reql;
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user