From 806e6cf392b36bf25da93beed7bcc4ef04ccc4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 9 May 2022 16:22:29 +0200 Subject: [PATCH] MINOR: quic: Stateless reset token copy to transport parameters A server may send the stateless reset token associated to the current connection from its transport parameters. So, let's copy it from qc_lstnt_params_init(). --- src/xprt_quic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 4a2e3ddfd..a5bfa4a9d 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -4391,12 +4391,16 @@ static int parse_retry_token(const unsigned char *token, uint64_t token_len, */ static int qc_lstnr_params_init(struct quic_conn *qc, struct listener *l, const unsigned char *token, size_t token_len, + const struct quic_connection_id *icid, const struct quic_cid *dcid) { struct quic_cid *odcid = &qc->rx.params.original_destination_connection_id; /* Copy the transport parameters. */ qc->rx.params = l->bind_conf->quic_params; + /* Copy the stateless reset token */ + memcpy(qc->rx.params.stateless_reset_token, icid->stateless_reset_token, + sizeof qc->rx.params.stateless_reset_token); /* Copy original_destination_connection_id transport parameter. */ if (token_len) { if (parse_retry_token(token, token_len, odcid)) { @@ -4544,7 +4548,7 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4, qc->sendto_err = 0; memcpy(&qc->peer_addr, saddr, sizeof qc->peer_addr); - if (server && !qc_lstnr_params_init(qc, l, token, token_len, dcid)) + if (server && !qc_lstnr_params_init(qc, l, token, token_len, icid, dcid)) goto err; TRACE_LEAVE(QUIC_EV_CONN_INIT, qc);