Automated g4 rollback of changelist 253848976.
*** Reason for rollback ***
QuicDispatcherTest is broken
*** Original change description ***
Make QuicDispatcher drop packets that have an initial destination connection ID that is too short
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: 253915913
Change-Id: I2f58216427011bf52bb7ba98be1e254161ecc8af
diff --git a/quic/core/quic_dispatcher.cc b/quic/core/quic_dispatcher.cc
index 140c45a..7ad7bca 100644
--- a/quic/core/quic_dispatcher.cc
+++ b/quic/core/quic_dispatcher.cc
@@ -351,14 +351,9 @@
QUIC_DLOG(INFO) << "Packet with short destination connection ID "
<< server_connection_id << " expected "
<< static_cast<int>(expected_server_connection_id_length);
- 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, header.form,
- header.version_flag, header.version);
+ ProcessUnauthenticatedHeaderFate(kFateTimeWait, server_connection_id,
+ header.form, header.version_flag,
+ header.version);
return false;
}
diff --git a/quic/core/quic_dispatcher_test.cc b/quic/core/quic_dispatcher_test.cc
index b05a0ab..094b293 100644
--- a/quic/core/quic_dispatcher_test.cc
+++ b/quic/core/quic_dispatcher_test.cc
@@ -840,23 +840,6 @@
ProcessPacket(client_address, TestConnectionId(1), true, SerializeCHLO());
}
-TEST_F(QuicDispatcherTest, ProcessPacketWithInvalidShortInitialConnectionId) {
- SetQuicReloadableFlag(quic_drop_invalid_small_initial_connection_id, true);
- CreateTimeWaitListManager();
-
- QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
-
- // dispatcher_ should drop this packet.
- EXPECT_CALL(*dispatcher_,
- CreateQuicSession(_, client_address, QuicStringPiece("hq"), _))
- .Times(0);
- EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, _, _, _)).Times(0);
- EXPECT_CALL(*time_wait_list_manager_,
- AddConnectionIdToTimeWait(_, _, _, _, _))
- .Times(0);
- ProcessPacket(client_address, EmptyQuicConnectionId(), true, SerializeCHLO());
-}
-
TEST_F(QuicDispatcherTest, OKSeqNoPacketProcessed) {
QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
QuicConnectionId connection_id = TestConnectionId(1);
@@ -937,7 +920,6 @@
// Packets with truncated connection IDs should be dropped.
TEST_F(QuicDispatcherTestStrayPacketConnectionId,
StrayPacketTruncatedConnectionId) {
- SetQuicReloadableFlag(quic_drop_invalid_small_initial_connection_id, true);
CreateTimeWaitListManager();
QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
@@ -945,6 +927,8 @@
EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, QuicStringPiece("hq"), _))
.Times(0);
if (VersionHasIetfInvariantHeader(
+ CurrentSupportedVersions()[0].transport_version) &&
+ !QuicUtils::VariableLengthConnectionIdAllowedForVersion(
CurrentSupportedVersions()[0].transport_version)) {
// This IETF packet has invalid connection ID length.
EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, _, _, _))
@@ -953,8 +937,10 @@
AddConnectionIdToTimeWait(_, _, _, _, _))
.Times(0);
} else {
- // This is a GQUIC packet considered as IETF QUIC packet with short header
- // with unacceptable packet number.
+ // This is either:
+ // - a GQUIC packet considered as IETF QUIC packet with short header
+ // with unacceptable packet number or
+ // - an IETF QUIC packet with bad connection ID length which is rejected.
EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, _, _, _))
.Times(1);
EXPECT_CALL(*time_wait_list_manager_,