Make QuicDispatcher drop packets that have an initial destination connection ID that is too short
This is a rollback of cl/253915913 and roll-forward of cl/253848976.
The rollback was caused by QuicDispatcherTest.ProcessPacketWithInvalidShortInitialConnectionId failing, which was unfortunately not caught by presubmits. The test was attempting to use an empty connection ID with v46 and failing in a QUIC_BUG as that is not legal to send in v46. This CL fixes that by enabling v47 at the start of the test.
With this CL, QuicDispatcher will drop packets that have an initial destination connection ID that is too short, instead of responding with a Version Negotiation packet to reject it.
gfe-relnote: drop a kind of invalid packet, protected by --gfe2_reloadable_flag_quic_drop_invalid_small_initial_connection_id
PiperOrigin-RevId: 254015843
Change-Id: I20d6d64b0a5a8f6cace2ed90dc473c03428064b2
diff --git a/quic/core/quic_dispatcher.cc b/quic/core/quic_dispatcher.cc
index 37f1901..aeda8fc 100644
--- a/quic/core/quic_dispatcher.cc
+++ b/quic/core/quic_dispatcher.cc
@@ -327,7 +327,13 @@
QUIC_DLOG(INFO) << "Packet with short destination connection ID "
<< server_connection_id << " expected "
<< static_cast<int>(expected_server_connection_id_length_);
- ProcessUnauthenticatedHeaderFate(kFateTimeWait, server_connection_id, form,
+ QuicPacketFate fate = kFateDrop;
+ if (!GetQuicReloadableFlag(quic_drop_invalid_small_initial_connection_id)) {
+ fate = kFateTimeWait;
+ } else {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_drop_invalid_small_initial_connection_id);
+ }
+ ProcessUnauthenticatedHeaderFate(fate, server_connection_id, form,
version_flag, version);
return true;
}