diff --git a/include/haproxy/connection-t.h b/include/haproxy/connection-t.h index 4e4b65ee8..0372ebfcd 100644 --- a/include/haproxy/connection-t.h +++ b/include/haproxy/connection-t.h @@ -37,7 +37,6 @@ #include #include #include -#include /* referenced below */ struct connection; @@ -519,11 +518,11 @@ enum conn_hash_params_t { * connection hash. */ struct conn_hash_params { + uint64_t sni_prehash; + uint64_t proxy_prehash; void *target; - XXH64_hash_t sni_prehash; struct sockaddr_storage *src_addr; struct sockaddr_storage *dst_addr; - XXH64_hash_t proxy_prehash; }; /* This structure describes a connection with its methods and data. diff --git a/include/haproxy/connection.h b/include/haproxy/connection.h index bd809e128..a50b0bb4f 100644 --- a/include/haproxy/connection.h +++ b/include/haproxy/connection.h @@ -37,6 +37,7 @@ #include #include #include +#include extern struct pool_head *pool_head_connection; @@ -1197,9 +1198,9 @@ static inline int conn_upgrade_mux_fe(struct connection *conn, void *ctx, struct /* Generate the hash of a connection with params as input * Each non-null field of params is taken into account for the hash calcul. */ -XXH64_hash_t conn_calculate_hash(const struct conn_hash_params *params); +uint64_t conn_calculate_hash(const struct conn_hash_params *params); -static inline XXH64_hash_t conn_hash_prehash(char *buf, size_t size) +static inline uint64_t conn_hash_prehash(char *buf, size_t size) { return XXH64(buf, size, 0); } @@ -1218,11 +1219,11 @@ static inline void conn_hash_update(char *buf, size_t *idx, *flags |= type; } -static inline XXH64_hash_t conn_hash_digest(char *buf, size_t bufsize, - enum conn_hash_params_t flags) +static inline uint64_t conn_hash_digest(char *buf, size_t bufsize, + enum conn_hash_params_t flags) { const uint64_t flags_u64 = (uint64_t)flags; - const XXH64_hash_t hash = XXH64(buf, bufsize, 0); + const uint64_t hash = XXH64(buf, bufsize, 0); return (flags_u64 << CONN_HASH_PAYLOAD_LEN) | CONN_HASH_GET_PAYLOAD(hash); } diff --git a/src/connection.c b/src/connection.c index eaee3191a..2e734f724 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1627,11 +1627,11 @@ static void conn_calculate_hash_sockaddr(const struct sockaddr_storage *ss, } } -XXH64_hash_t conn_calculate_hash(const struct conn_hash_params *params) +uint64_t conn_calculate_hash(const struct conn_hash_params *params) { char *buf; size_t idx = 0; - XXH64_hash_t hash = 0; + uint64_t hash = 0; enum conn_hash_params_t hash_flags = 0; buf = trash.area;