]> git.kaiwu.me - haproxy.git/commit
MINOR: sample: add the "be_sort" converter
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 17 Sep 2026 12:56:44 +0000 (12:56 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 17 Sep 2026 12:56:44 +0000 (12:56 +0000)
commit741c143ed8fc201fa8a0c59198c156cf3122f9b4
treebb63252f9ff377a521944616ad0b1123e869bbb0
parent5a41de386299897c4eada95e640b35dbd86367e5
MINOR: sample: add the "be_sort" converter

This converter sorts in ascending numerical order the big-endian unsigned
integers of <elem_size> bytes stored in a binary sample. <elem_size> must
be 1, 2, 4 or 8, and the input length must be a multiple of <elem_size>,
otherwise the conversion fails.

Since the elements are unsigned and stored in network byte order, comparing
their bytes starting from the most significant one gives the numerical
order, so a simple memcmp() over the element width is enough and no byte
swapping is needed.

It is mainly intended to normalize a list of binary values whose order may
vary from one client to another before hashing it, for instance the cipher
list or the extension list of a TLS client hello:

    http-request set-var(txn.ciphers) \
        ssl_fc_cipherlist_bin(1),be_sort(2),xxh64

Documentation was updated.
doc/configuration.txt
src/sample.c