]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Add the packet type to quic_tx_packet struct
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 3 Aug 2021 13:03:35 +0000 (15:03 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
This is required to build packets from the same function.

include/haproxy/xprt_quic-t.h
src/xprt_quic.c

index 4eca0c93aa294ef85b8ff31540221e9376983e5c..15b3bb87f290a3e0befa0473603b00dc6de97d08 100644 (file)
@@ -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
index 90761c9f2ce0579886f9139a356f9c08b1a8046a..623a12e32a9337e28a5c0a8206d3f38720e1d508 100644 (file)
@@ -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;