mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-15 07:51:04 +01:00
MINOR: quic: extend traces on CID allocation
Add new traces to detect the CID generation method and also when an Initial packet is requeued due to CID collision.
This commit is contained in:
parent
2623e0a0b7
commit
a9d11ab7f3
@ -159,13 +159,17 @@ int quic_cid_generate(struct quic_connection_id *conn_id)
|
|||||||
conn_id->cid.len = QUIC_HAP_CID_LEN;
|
conn_id->cid.len = QUIC_HAP_CID_LEN;
|
||||||
|
|
||||||
if (quic_newcid_from_hash64) {
|
if (quic_newcid_from_hash64) {
|
||||||
|
TRACE_DEVEL("calculate CID value from conn hash", QUIC_EV_CONN_TXPKT, qc);
|
||||||
quic_newcid_from_hash64(conn_id->cid.data, conn_id->cid.len, qc->hash64,
|
quic_newcid_from_hash64(conn_id->cid.data, conn_id->cid.len, qc->hash64,
|
||||||
global.cluster_secret, sizeof(global.cluster_secret));
|
global.cluster_secret, sizeof(global.cluster_secret));
|
||||||
}
|
}
|
||||||
else if (RAND_bytes(conn_id->cid.data, conn_id->cid.len) != 1) {
|
else {
|
||||||
/* TODO: RAND_bytes() should be replaced */
|
TRACE_DEVEL("generate CID value from random generator", QUIC_EV_CONN_TXPKT, qc);
|
||||||
TRACE_ERROR("RAND_bytes() failed", QUIC_EV_CONN_TXPKT, qc);
|
if (RAND_bytes(conn_id->cid.data, conn_id->cid.len) != 1) {
|
||||||
goto err;
|
/* TODO: RAND_bytes() should be replaced */
|
||||||
|
TRACE_ERROR("RAND_bytes() failed", QUIC_EV_CONN_TXPKT, qc);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quic_stateless_reset_token_init(conn_id) != 1) {
|
if (quic_stateless_reset_token_init(conn_id) != 1) {
|
||||||
@ -202,6 +206,7 @@ int quic_cid_derive_from_odcid(struct quic_connection_id *conn_id,
|
|||||||
|
|
||||||
conn_id->cid.len = QUIC_HAP_CID_LEN;
|
conn_id->cid.len = QUIC_HAP_CID_LEN;
|
||||||
|
|
||||||
|
TRACE_DEVEL("derive CID value from a client ODCID", QUIC_EV_CONN_TXPKT);
|
||||||
/* Derive the new CID value from original CID. */
|
/* Derive the new CID value from original CID. */
|
||||||
conn_id->cid = quic_derive_cid(orig, addr);
|
conn_id->cid = quic_derive_cid(orig, addr);
|
||||||
|
|
||||||
|
|||||||
@ -1798,6 +1798,7 @@ static struct quic_conn *quic_rx_pkt_retrieve_conn(struct quic_rx_packet *pkt,
|
|||||||
* <new_tid> will be set to redispatch the
|
* <new_tid> will be set to redispatch the
|
||||||
* current packet.
|
* current packet.
|
||||||
*/
|
*/
|
||||||
|
TRACE_STATE("duplicate CID on Initial", QUIC_EV_CONN_LPKT);
|
||||||
pool_free(pool_head_quic_connection_id, conn_id);
|
pool_free(pool_head_quic_connection_id, conn_id);
|
||||||
quic_conn_release(qc);
|
quic_conn_release(qc);
|
||||||
qc = NULL;
|
qc = NULL;
|
||||||
@ -2346,6 +2347,7 @@ int quic_dgram_parse(struct quic_dgram *dgram, struct quic_conn *from_qc,
|
|||||||
*/
|
*/
|
||||||
if (!qc) {
|
if (!qc) {
|
||||||
if (new_tid >= 0) {
|
if (new_tid >= 0) {
|
||||||
|
TRACE_STATE("re-enqueue packet to conn thread", QUIC_EV_CONN_LPKT);
|
||||||
MT_LIST_APPEND(&quic_dghdlrs[new_tid].dgrams,
|
MT_LIST_APPEND(&quic_dghdlrs[new_tid].dgrams,
|
||||||
&dgram->handler_list);
|
&dgram->handler_list);
|
||||||
tasklet_wakeup(quic_dghdlrs[new_tid].task);
|
tasklet_wakeup(quic_dghdlrs[new_tid].task);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user