#define QUIC_TP_PREFERRED_ADDRESS 13
#define QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT 14
#define QUIC_TP_INITIAL_SOURCE_CONNECTION_ID 15
+#define QUIC_TP_RETRY_SOURCE_CONNECTION_ID 16
/*
* These defines are not for transport parameter type, but the maximum accepted value for
* When received by clients, must be set to 1 if present.
*/
struct quic_cid original_destination_connection_id; /* Forbidden for clients */
+ /*
+ * MUST be sent by servers after Retry.
+ */
+ struct quic_cid retry_source_connection_id; /* Forbidden for clients */
/* MUST be present both for servers and clients. */
struct quic_cid initial_source_connection_id;
struct preferred_address preferred_address; /* Forbidden for clients */
p->with_stateless_reset_token = 1;
p->active_connection_id_limit = 8;
+ p->retry_source_connection_id.len = 0;
+
}
/* Encode <addr> preferred address transport parameter in <buf> without its
p->original_destination_connection_id.data,
p->original_destination_connection_id.len))
return 0;
+
+ if (p->retry_source_connection_id.len) {
+ if (!quic_transport_param_enc_mem(&pos, end,
+ QUIC_TP_RETRY_SOURCE_CONNECTION_ID,
+ p->retry_source_connection_id.data,
+ p->retry_source_connection_id.len))
+ return 0;
+ }
+
if (p->with_stateless_reset_token &&
!quic_transport_param_enc_mem(&pos, end, QUIC_TP_STATELESS_RESET_TOKEN,
p->stateless_reset_token,
TRACE_PROTO("Error during Initial token parsing", QUIC_EV_CONN_LPKT, qc);
goto err;
}
+ /* Copy retry_source_connection_id transport parameter. */
+ quic_cid_cpy(&qc->rx.params.retry_source_connection_id,
+ &pkt->dcid);
}
else {
memcpy(odcid->data, &pkt->dcid.data, pkt->dcid.len);