gfe-relnote: Drop QUIC INITIAL packets which are less than 1200 bytes. Protected by --gfe2_reloadable_flag_quic_drop_small_initial_packets
PiperOrigin-RevId: 286621288
Change-Id: I46543378213f091886662d4963b84a5b74ac3e9f
diff --git a/quic/core/quic_dispatcher.cc b/quic/core/quic_dispatcher.cc
index 9c71d41..c628993 100644
--- a/quic/core/quic_dispatcher.cc
+++ b/quic/core/quic_dispatcher.cc
@@ -149,6 +149,9 @@
const QuicSocketAddress& peer_address,
QuicErrorCode error_code,
const std::string& error_details) {
+ // TODO(rch): Remove this method when quic_drop_small_initial_packets is
+ // deprecated.
+ DCHECK(!GetQuicReloadableFlag(quic_drop_small_initial_packets));
SerializeConnectionClosePacket(error_code, error_details);
for (const auto& packet : *collector_.packets()) {
@@ -457,6 +460,13 @@
packet_info.form == IETF_QUIC_LONG_HEADER_PACKET &&
packet_info.long_packet_type == INITIAL &&
packet_info.packet.length() < kMinClientInitialPacketLength) {
+ if (GetQuicReloadableFlag(quic_drop_small_initial_packets)) {
+ QUIC_DVLOG(1) << "Dropping initial packet which is too short, length: "
+ << packet_info.packet.length();
+ QUIC_CODE_COUNT(quic_drop_small_initial_packets);
+ QUIC_RELOADABLE_FLAG_COUNT(quic_drop_small_initial_packets);
+ return true;
+ }
StatelessConnectionTerminator terminator(
packet_info.destination_connection_id, packet_info.version,
helper_.get(), time_wait_list_manager_.get());