diff --git a/src/quic_sock.c b/src/quic_sock.c index 4cd9317cc..6aabb24a1 100644 --- a/src/quic_sock.c +++ b/src/quic_sock.c @@ -818,14 +818,12 @@ int qc_rcv_buf(struct quic_conn *qc) struct quic_dgram *new_dgram = NULL; struct buffer buf = BUF_NULL; unsigned char *dgram_buf; - struct listener *l; ssize_t ret = 0; /* Do not call this if quic-conn FD is uninitialized. */ BUG_ON(qc->fd < 0); TRACE_ENTER(QUIC_EV_CONN_RCV, qc); - l = qc->li; do { if (!b_alloc(&buf, DB_MUX_RX)) @@ -871,7 +869,7 @@ int qc_rcv_buf(struct quic_conn *qc) continue; } - if (!qc_check_dcid(qc, new_dgram->dcid, new_dgram->dcid_len)) { + if (qc_is_listener(qc) && !qc_check_dcid(qc, new_dgram->dcid, new_dgram->dcid_len)) { /* Datagram received by error on the connection FD, dispatch it * to its associated quic-conn. * @@ -881,6 +879,7 @@ int qc_rcv_buf(struct quic_conn *qc) struct quic_dgram *tmp_dgram; unsigned char *rxbuf_tail; size_t cspace; + struct listener *l = qc->li; TRACE_STATE("datagram for other connection on quic-conn socket, requeue it", QUIC_EV_CONN_RCV, qc);