The 32-bits version field of the Retry paquet was inversed by the code. As this
field must be in the network byte order on the wire, this code has supposed that
the sender of the Retry packet will always be little endian. Hopefully this is
often the case on our Intel machines ;)
Must be backported as far as 2.6.
(quic_pkt_type(QUIC_PACKET_TYPE_RETRY, qv->num) << QUIC_PACKET_TYPE_SHIFT) |
statistical_prng_range(16);
/* version */
- buf[i++] = *((unsigned char *)&qv->num + 3);
- buf[i++] = *((unsigned char *)&qv->num + 2);
- buf[i++] = *((unsigned char *)&qv->num + 1);
- buf[i++] = *(unsigned char *)&qv->num;
+ *(uint32_t *)&buf[i] = htonl(qv->num);
+ i += sizeof(uint32_t);
/* Use the SCID from <pkt> for Retry DCID. */
buf[i++] = pkt->scid.len;