MINOR: quic: Possible endless loop in qc_treat_rx_pkts()
Ensure we do not endlessly treat always the same encryption level
in qc_treat_rx_pkts().
diff --git a/src/xprt_quic.c b/src/xprt_quic.c
index e9055e9..98fef55 100644
--- a/src/xprt_quic.c
+++ b/src/xprt_quic.c
@@ -2643,7 +2643,9 @@
return 0;
}
-/* Process all the packets at <el> encryption level.
+/* Process all the packets at <el> and <next_el> encryption level.
+ * This is the caller responsability to check that <cur_el> is different of <next_el>
+ * as pointer value.
* Return 1 if succeeded, 0 if not.
*/
int qc_treat_rx_pkts(struct quic_enc_level *cur_el, struct quic_enc_level *next_el,
@@ -2706,6 +2708,7 @@
goto err;
if (qel == cur_el) {
+ BUG_ON(qel == next_el);
qel = next_el;
goto next_tel;
}
@@ -2787,9 +2790,11 @@
skip_send:
/* Check if there is something to do for the next level.
*/
- if (next_qel && (next_qel->tls_ctx.rx.flags & QUIC_FL_TLS_SECRETS_SET) &&
+ if (next_qel && next_qel != qel &&
+ (next_qel->tls_ctx.rx.flags & QUIC_FL_TLS_SECRETS_SET) &&
(!MT_LIST_ISEMPTY(&next_qel->rx.pqpkts) || !eb_is_empty(&next_qel->rx.pkts))) {
qel = next_qel;
+ next_qel = NULL;
goto next_level;
}