From 1e959ad522e3e84a0e1f4e88ca017791a3708a28 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 13 Apr 2023 17:34:56 +0200 Subject: [PATCH] MINOR: quic: remove TID encoding in CID CIDs were moved from a per-thread list to a global list instance. The TID-encoded is thus non needed anymore. This should be backported up to 2.7 after a period of observation. --- include/haproxy/quic_conn.h | 11 ----------- src/quic_conn.c | 7 +------ 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/include/haproxy/quic_conn.h b/include/haproxy/quic_conn.h index b52535ff3e..a3cd423d2d 100644 --- a/include/haproxy/quic_conn.h +++ b/include/haproxy/quic_conn.h @@ -208,17 +208,6 @@ static inline void quic_connection_id_to_frm_cpy(struct quic_frame *dst, to->stateless_reset_token = src->stateless_reset_token; } -/* Modify to have a CID linked to the thread ID that - * quic_get_cid_tid() will be able to extract return. - */ -static inline void quic_pin_cid_to_tid(unsigned char *cid, uint target_tid) -{ - uint16_t prev_id; - - prev_id = read_n16(cid); - write_n16(cid, (prev_id & ~4095) | target_tid); -} - /* Return a 32-bits integer in from QUIC packet with as address. * Makes point to the data after this 32-bits value if succeeded. * Note that these 32-bits integers are network bytes ordered. diff --git a/src/quic_conn.c b/src/quic_conn.c index 1a6d1176a0..e4145f6dcc 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -3906,8 +3906,7 @@ static int quic_stateless_reset_token_init(struct quic_connection_id *conn_id) return ret; } -/* Generate a CID directly derived from CID and address. The CID - * is then marked with the current thread ID. +/* Generate a CID directly derived from CID and address. * * Returns the derived CID. */ @@ -3962,9 +3961,6 @@ struct quic_cid quic_derive_cid(const struct quic_cid *orig, cid.data[i] = hash >> ((sizeof(hash) * 7) - (8 * i)); cid.len = sizeof(hash); - /* Mark the current thread id in the CID. */ - quic_pin_cid_to_tid(cid.data, tid); - return cid; } @@ -4055,7 +4051,6 @@ static struct quic_connection_id *new_quic_cid(struct eb_root *root, TRACE_ERROR("RAND_bytes() failed", QUIC_EV_CONN_TXPKT, qc); goto err; } - quic_pin_cid_to_tid(conn_id->cid.data, tid); } else { /* Derive the new CID value from original CID. */ -- 2.47.3