MINOR: quic: Pass CID as a buffer to quic_get_cid_tid()

Very minor modification so that this function might be used for a context
without CID (at datagram level).
This commit is contained in:
Frédéric Lécaille 2022-01-26 18:04:50 +01:00 committed by Amaury Denoyelle
parent 69dd5e6a0b
commit 220894a5d6
2 changed files with 3 additions and 3 deletions

View file

@ -133,9 +133,9 @@ static inline void quic_cid_dump(struct buffer *buf,
}
/* Simply compute a thread ID from a CID */
static inline unsigned long quic_get_cid_tid(const struct quic_cid *cid)
static inline unsigned long quic_get_cid_tid(const unsigned char *cid)
{
return cid->data[0] % global.nbthread;
return *cid % global.nbthread;
}
/* Free the CIDs attached to <conn> QUIC connection. This must be called under

View file

@ -4160,7 +4160,7 @@ int qc_conn_alloc_ssl_ctx(struct quic_conn *qc)
/* Set tasklet tid based on the SCID selected by us for this
* connection. The upper layer will also be binded on the same thread.
*/
qc->tid = ctx->wait_event.tasklet->tid = quic_get_cid_tid(&qc->scid);
qc->tid = ctx->wait_event.tasklet->tid = quic_get_cid_tid(qc->scid.data);
if (qc_is_listener(qc)) {
if (qc_ssl_sess_init(qc, bc->initial_ctx, &ctx->ssl,