From 11891e1ce489c64ed5daae08ef9cae6edcc4bf7e Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Mon, 4 Nov 2024 17:55:38 +0100 Subject: [PATCH] MINOR: quic: Help diagnosing malformed probing packets Add a BUG_ON() to detect some malformed packets which are supposed to probe the peer without being ack-eliciting: the peer would not acknowledged such packets. --- src/quic_tx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/quic_tx.c b/src/quic_tx.c index b2ad2ad34..4a72e9fe9 100644 --- a/src/quic_tx.c +++ b/src/quic_tx.c @@ -2071,6 +2071,8 @@ static int qc_do_build_pkt(unsigned char *pos, const unsigned char *end, goto no_room; } + BUG_ON(qel->pktns->tx.pto_probe && + !(pkt->flags & QUIC_FL_TX_PACKET_ACK_ELICITING)); /* If this packet is ack-eliciting and we are probing let's * decrement the PTO probe counter. */