Deprecate quic_use_length_prefix_from_packet_info This CL also removes the client-side workaround for b/139330014 since this flag deprecation ensures that all our servers now have the fix. gfe-relnote: deprecate gfe2_reloadable_flag_quic_use_length_prefix_from_packet_info PiperOrigin-RevId: 273647689 Change-Id: Ib36b0fb8c2af6d6dd18173dbddb61998ad371692
diff --git a/quic/core/quic_dispatcher.cc b/quic/core/quic_dispatcher.cc index eec468a..acc5cb3 100644 --- a/quic/core/quic_dispatcher.cc +++ b/quic/core/quic_dispatcher.cc
@@ -444,22 +444,12 @@ // packet and stop processing the current packet. QuicConnectionId client_connection_id = packet_info.source_connection_id; - bool use_length_prefix = packet_info.use_length_prefix; - if (!GetQuicReloadableFlag(quic_use_length_prefix_from_packet_info)) { - use_length_prefix = packet_info.form != GOOGLE_QUIC_PACKET && - !QuicVersionLabelUses4BitConnectionIdLength( - packet_info.version_label); - } else { - QUIC_RELOADABLE_FLAG_COUNT(quic_use_length_prefix_from_packet_info); - // TODO(dschinazi) remove the client-side workaround in - // QuicFramer::ParseServerVersionNegotiationProbeResponse - // when quic_use_length_prefix_from_packet_info is deprecated. - } time_wait_list_manager()->SendVersionNegotiationPacket( server_connection_id, client_connection_id, - packet_info.form != GOOGLE_QUIC_PACKET, use_length_prefix, - GetSupportedVersions(), packet_info.self_address, - packet_info.peer_address, GetPerPacketContext()); + packet_info.form != GOOGLE_QUIC_PACKET, + packet_info.use_length_prefix, GetSupportedVersions(), + packet_info.self_address, packet_info.peer_address, + GetPerPacketContext()); } return true; }
diff --git a/quic/core/quic_dispatcher_test.cc b/quic/core/quic_dispatcher_test.cc index 48a1aa6..280d110 100644 --- a/quic/core/quic_dispatcher_test.cc +++ b/quic/core/quic_dispatcher_test.cc
@@ -1014,7 +1014,6 @@ TEST_F(QuicDispatcherTest, VersionNegotiationProbeOld) { SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, false); - SetQuicReloadableFlag(quic_use_length_prefix_from_packet_info, true); QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); CreateTimeWaitListManager(); char packet[1200]; @@ -1044,7 +1043,6 @@ TEST_F(QuicDispatcherTest, VersionNegotiationProbe) { SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, true); - SetQuicReloadableFlag(quic_use_length_prefix_from_packet_info, true); QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1); CreateTimeWaitListManager(); char packet[1200]; @@ -1098,7 +1096,6 @@ TEST_F(QuicDispatcherTest, VersionNegotiationProbeEndToEndOld) { SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, false); - SetQuicReloadableFlag(quic_use_length_prefix_from_packet_info, true); SavingWriter* saving_writer = new SavingWriter(); // dispatcher_ takes ownership of saving_writer. @@ -1143,7 +1140,6 @@ TEST_F(QuicDispatcherTest, VersionNegotiationProbeEndToEnd) { SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, true); - SetQuicReloadableFlag(quic_use_length_prefix_from_packet_info, true); SavingWriter* saving_writer = new SavingWriter(); // dispatcher_ takes ownership of saving_writer.
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc index 402135b..7c205cd 100644 --- a/quic/core/quic_framer.cc +++ b/quic/core/quic_framer.cc
@@ -6584,27 +6584,6 @@ return false; } - if (!use_length_prefix && source_connection_id.length() == 0) { - // We received a bad response due to b/139330014. - // Reparse the packet assuming length prefixes. - // This is a temporary client-side workaround until cl/263172621 is - // deployed on production servers. - // TODO(dschinazi): remove this client-side workaround once the server-side - // fix is deployed. - QuicDataReader reader2(packet_bytes, packet_length); - uint8_t type_byte2 = 0; - uint32_t version2 = 0; - QuicConnectionId destination_connection_id2, source_connection_id2; - if (reader2.ReadUInt8(&type_byte2) && reader2.ReadUInt32(&version2) && - reader2.ReadLengthPrefixedConnectionId(&destination_connection_id2) && - reader2.ReadLengthPrefixedConnectionId(&source_connection_id2) && - (type_byte2 & 0x80) != 0 && version2 == 0 && - destination_connection_id2.length() == 0 && - source_connection_id2.length() != 0) { - source_connection_id = source_connection_id2; - } - } - memcpy(source_connection_id_bytes, source_connection_id.data(), source_connection_id.length()); *source_connection_id_length_out = source_connection_id.length();
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc index 14de6e9..5ca325c 100644 --- a/quic/core/quic_framer_test.cc +++ b/quic/core/quic_framer_test.cc
@@ -13524,39 +13524,6 @@ probe_payload_bytes, sizeof(probe_payload_bytes)); } -// Test the client-side workaround for b/139330014 where an old client expects -// no length prefix but receives a length-prefixed response. -TEST_P(QuicFramerTest, ParseBadServerVersionNegotiationProbeResponse) { - SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, false); - // clang-format off - const char packet[] = { - // IETF long header with fixed bit set, type initial, all-0 encrypted bits. - 0xc0, - // Version of 0, indicating version negotiation. - 0x00, 0x00, 0x00, 0x00, - // Destination connection ID length 0, source connection ID length 8. - 0x00, 0x08, - // 8-byte source connection ID. - 0x56, 0x4e, 0x20, 0x70, 0x6c, 0x7a, 0x20, 0x21, - // A few supported versions. - 0xaa, 0xaa, 0xaa, 0xaa, - QUIC_VERSION_BYTES, - }; - // clang-format on - char probe_payload_bytes[] = {0x56, 0x4e, 0x20, 0x70, 0x6c, 0x7a, 0x20, 0x21}; - char parsed_probe_payload_bytes[255] = {}; - uint8_t parsed_probe_payload_length = 0; - std::string parse_detailed_error = ""; - EXPECT_TRUE(QuicFramer::ParseServerVersionNegotiationProbeResponse( - reinterpret_cast<const char*>(packet), sizeof(packet), - reinterpret_cast<char*>(parsed_probe_payload_bytes), - &parsed_probe_payload_length, &parse_detailed_error)); - EXPECT_EQ("", parse_detailed_error); - test::CompareCharArraysWithHexError( - "parsed probe", parsed_probe_payload_bytes, parsed_probe_payload_length, - probe_payload_bytes, sizeof(probe_payload_bytes)); -} - TEST_P(QuicFramerTest, ClientConnectionIdFromLongHeaderToClient) { if (framer_.transport_version() <= QUIC_VERSION_43) { // This test requires an IETF long header.