From: Dragan Dosen Date: Thu, 16 Jun 2016 09:08:08 +0000 (+0200) Subject: BUG/MINOR: http: url32+src should use the big endian version of url32 X-Git-Tag: v1.7-dev4~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5f4133b197a57a4043c180b21649ea67c3a2a11;p=thirdparty%2Fhaproxy.git BUG/MINOR: http: url32+src should use the big endian version of url32 This is similar to the commit 5ad6e1dc ("BUG/MINOR: http: base32+src should use the big endian version of base32"). Now we convert url32 to big endian when building the binary block. This patch needs to be backported to 1.6 and 1.5. --- diff --git a/src/proto_http.c b/src/proto_http.c index 3ca456e824..77122817fc 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -11653,17 +11653,13 @@ smp_fetch_url32_src(const struct arg *args, struct sample *smp, const char *kw, { struct chunk *temp; struct connection *cli_conn = objt_conn(smp->sess->origin); - unsigned int hash; if (!smp_fetch_url32(args, smp, kw, private)) return 0; - /* The returned hash is a 32 bytes integer. */ - hash = smp->data.u.sint; - temp = get_trash_chunk(); - memcpy(temp->str + temp->len, &hash, sizeof(hash)); - temp->len += sizeof(hash); + *(unsigned int *)temp->str = htonl(smp->data.u.sint); + temp->len += sizeof(unsigned int); switch (cli_conn->addr.from.ss_family) { case AF_INET: