From b7e95fdba758e4def6a202fb5c718bf61415cf72 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Tue, 2 Mar 2021 22:51:50 -0800 Subject: [PATCH] Pad ack-eliciting initial-bearing datagrams from servers Quoth the spec: a server MUST expand the payload of all UDP datagrams carrying ack-eliciting Initial packets to at least the smallest allowed maximum datagram size of 1200 bytes. --- quinn-proto/src/connection/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index cb4329eb7..d7fe2d1e4 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -636,7 +636,9 @@ where )?); coalesce = coalesce && !builder.short_header; - pad_datagram |= space_id == SpaceId::Initial && self.side.is_client(); + // https://tools.ietf.org/html/draft-ietf-quic-transport-34#section-14.1 + pad_datagram |= + space_id == SpaceId::Initial && (self.side.is_client() || ack_eliciting); if close { trace!("sending CONNECTION_CLOSE");