MINOR: quic: Add the packet type to quic_tx_packet struct

This is required to build packets from the same function.
This commit is contained in:
Frédéric Lécaille 2021-08-03 15:03:35 +02:00 committed by Amaury Denoyelle
parent 522c65ce39
commit 0e50e1b0b5
2 changed files with 5 additions and 3 deletions

View File

@ -486,6 +486,7 @@ struct quic_tx_packet {
int refcnt; int refcnt;
/* Next packet in the same datagram */ /* Next packet in the same datagram */
struct quic_tx_packet *next; struct quic_tx_packet *next;
unsigned char type;
}; };
#define QUIC_CRYPTO_BUF_SHIFT 10 #define QUIC_CRYPTO_BUF_SHIFT 10

View File

@ -3838,8 +3838,9 @@ static int qc_do_build_hdshk_pkt(unsigned char *pos, const unsigned char *end,
return 0; 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->len = 0;
pkt->cdata_len = 0; pkt->cdata_len = 0;
pkt->in_flight_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; goto err;
} }
quic_tx_packet_init(pkt); quic_tx_packet_init(pkt, pkt_type);
beg = *pos; beg = *pos;
pn_len = 0; pn_len = 0;
buf_pn = NULL; buf_pn = NULL;
@ -4091,7 +4092,7 @@ static struct quic_tx_packet *qc_build_phdshk_apkt(unsigned char **pos,
goto err; goto err;
} }
quic_tx_packet_init(pkt); quic_tx_packet_init(pkt, QUIC_PACKET_TYPE_SHORT);
beg = *pos; beg = *pos;
qel = &qc->els[QUIC_TLS_ENC_LEVEL_APP]; qel = &qc->els[QUIC_TLS_ENC_LEVEL_APP];
pn_len = 0; pn_len = 0;