diff --git a/src/quic_conn.c b/src/quic_conn.c index 378474010..5b643fd3a 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -1665,7 +1665,8 @@ int quic_conn_release(struct quic_conn *qc) /* Connection released before peer address validated. */ if (unlikely(!(qc->flags & QUIC_FL_CONN_PEER_VALIDATED_ADDR))) { - BUG_ON(!qc->prx_counters->half_open_conn); + /* half_open_conn counter must not be manipulated by BE conns. */ + BUG_ON(qc_is_back(qc) || !qc->prx_counters->half_open_conn); HA_ATOMIC_DEC(&qc->prx_counters->half_open_conn); } diff --git a/src/quic_rx.c b/src/quic_rx.c index 89944843e..70ac60695 100644 --- a/src/quic_rx.c +++ b/src/quic_rx.c @@ -1357,7 +1357,8 @@ int qc_treat_rx_pkts(struct quic_conn *qc) TRACE_STATE("validate peer address on handshake packet", QUIC_EV_CONN_RXPKT, qc, pkt); qc->flags |= QUIC_FL_CONN_PEER_VALIDATED_ADDR; - BUG_ON(!qc->prx_counters->half_open_conn); + /* half_open_conn counter must not be manipulated by BE conns. */ + BUG_ON(qc_is_back(qc) || !qc->prx_counters->half_open_conn); HA_ATOMIC_DEC(&qc->prx_counters->half_open_conn); }