]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Pass CID as a buffer to quic_get_cid_tid()
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 26 Jan 2022 17:04:50 +0000 (18:04 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 27 Jan 2022 15:37:55 +0000 (16:37 +0100)
Very minor modification so that this function might be used for a context
without CID (at datagram level).

include/haproxy/xprt_quic.h
src/xprt_quic.c

index 4bda6a74d6bf49b527113159117f08a10c39bb16..b76d6f34dcb2f668fc343c969fc95d1dde5d89c3 100644 (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
index cc3985e914a4abc9e407e1f33e7115d69abbb333..24c21535043aaf1e94df8a3d10f4d499a199ffb2 100644 (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,