From 0e50e1b0b56e294cb737040e6dc38e4378b1e06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Tue, 3 Aug 2021 15:03:35 +0200 Subject: [PATCH] MINOR: quic: Add the packet type to quic_tx_packet struct This is required to build packets from the same function. --- include/haproxy/xprt_quic-t.h | 1 + src/xprt_quic.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h index 4eca0c93a..15b3bb87f 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 90761c9f2..623a12e32 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;