From: Frédéric Lécaille Date: Tue, 3 Aug 2021 13:03:35 +0000 (+0200) Subject: MINOR: quic: Add the packet type to quic_tx_packet struct X-Git-Tag: v2.5-dev8~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e50e1b0b56e294cb737040e6dc38e4378b1e06f;p=thirdparty%2Fhaproxy.git MINOR: quic: Add the packet type to quic_tx_packet struct This is required to build packets from the same function. --- diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h index 4eca0c93aa..15b3bb87f2 100644 --- a/include/haproxy/xprt_quic-t.h +++ b/include/haproxy/xprt_quic-t.h @@ -486,6 +486,7 @@ struct quic_tx_packet { int refcnt; /* Next packet in the same datagram */ struct quic_tx_packet *next; + unsigned char type; }; #define QUIC_CRYPTO_BUF_SHIFT 10 diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 90761c9f2c..623a12e32a 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -3838,8 +3838,9 @@ static int qc_do_build_hdshk_pkt(unsigned char *pos, const unsigned char *end, return 0; } -static inline void quic_tx_packet_init(struct quic_tx_packet *pkt) +static inline void quic_tx_packet_init(struct quic_tx_packet *pkt, int type) { + pkt->type = type; pkt->len = 0; pkt->cdata_len = 0; pkt->in_flight_len = 0; @@ -3892,7 +3893,7 @@ static struct quic_tx_packet *qc_build_hdshk_pkt(unsigned char **pos, goto err; } - quic_tx_packet_init(pkt); + quic_tx_packet_init(pkt, pkt_type); beg = *pos; pn_len = 0; buf_pn = NULL; @@ -4091,7 +4092,7 @@ static struct quic_tx_packet *qc_build_phdshk_apkt(unsigned char **pos, goto err; } - quic_tx_packet_init(pkt); + quic_tx_packet_init(pkt, QUIC_PACKET_TYPE_SHORT); beg = *pos; qel = &qc->els[QUIC_TLS_ENC_LEVEL_APP]; pn_len = 0;