Deprecate --gfe2_reloadable_flag_quic_do_not_synthesize_source_cid_for_short_header.

PiperOrigin-RevId: 370540385
Change-Id: Id3be7b78c1c568c0955384abdbb44aa930c85fdb
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc
index 9e805ec..40397cc 100644
--- a/quic/core/quic_connection.cc
+++ b/quic/core/quic_connection.cc
@@ -388,7 +388,6 @@
 
   support_multiple_connection_ids_ =
       version().HasIetfQuicFrames() &&
-      framer_.do_not_synthesize_source_cid_for_short_header() &&
       GetQuicRestartFlag(quic_time_wait_list_support_multiple_cid_v2) &&
       GetQuicRestartFlag(
           quic_dispatcher_support_multiple_cid_per_connection_v2) &&
@@ -1048,7 +1047,6 @@
   }
 
   bool skip_server_connection_id_validation =
-      framer_.do_not_synthesize_source_cid_for_short_header() &&
       perspective_ == Perspective::IS_CLIENT &&
       header.form == IETF_QUIC_SHORT_HEADER_PACKET;
 
@@ -1084,11 +1082,8 @@
     return true;
   }
 
-  if (framer_.do_not_synthesize_source_cid_for_short_header() &&
-      perspective_ == Perspective::IS_SERVER &&
+  if (perspective_ == Perspective::IS_SERVER &&
       header.form == IETF_QUIC_SHORT_HEADER_PACKET) {
-    QUIC_RELOADABLE_FLAG_COUNT_N(
-        quic_do_not_synthesize_source_cid_for_short_header, 3, 3);
     return true;
   }
 
@@ -1123,8 +1118,7 @@
   // Check that any public reset packet with a different connection ID that was
   // routed to this QuicConnection has been redirected before control reaches
   // here.
-  QUICHE_DCHECK((framer_.do_not_synthesize_source_cid_for_short_header() &&
-                 perspective_ == Perspective::IS_CLIENT &&
+  QUICHE_DCHECK((perspective_ == Perspective::IS_CLIENT &&
                  header.form == IETF_QUIC_SHORT_HEADER_PACKET) ||
                 GetServerConnectionIdAsRecipient(header, perspective_) ==
                     ServerConnectionId() ||
diff --git a/quic/core/quic_connection_test.cc b/quic/core/quic_connection_test.cc
index 4f80a30..b0ded03 100644
--- a/quic/core/quic_connection_test.cc
+++ b/quic/core/quic_connection_test.cc
@@ -14012,7 +14012,8 @@
 TEST_P(QuicConnectionTest,
        PathValidationFailedOnClientDueToLackOfServerConnectionId) {
   if (!connection_.support_multiple_connection_ids() ||
-      !connection_.use_connection_id_on_default_path()) {
+      !connection_.use_connection_id_on_default_path() ||
+      !connection_.use_path_validator()) {
     return;
   }
   QuicConnectionPeer::EnableConnectionMigrationUseNewCID(&connection_);
@@ -14034,7 +14035,8 @@
 TEST_P(QuicConnectionTest,
        PathValidationFailedOnClientDueToLackOfClientConnectionIdTheSecondTime) {
   if (!connection_.support_multiple_connection_ids() ||
-      !connection_.use_connection_id_on_default_path()) {
+      !connection_.use_connection_id_on_default_path() ||
+      !connection_.use_path_validator()) {
     return;
   }
 
@@ -14114,7 +14116,8 @@
 
 TEST_P(QuicConnectionTest, ServerConnectionIdRetiredUponPathValidationFailure) {
   if (!connection_.support_multiple_connection_ids() ||
-      !connection_.use_connection_id_on_default_path()) {
+      !connection_.use_connection_id_on_default_path() ||
+      !connection_.use_path_validator()) {
     return;
   }
 
@@ -14177,7 +14180,8 @@
 TEST_P(QuicConnectionTest,
        MigratePathDirectlyFailedDueToLackOfClientConnectionIdTheSecondTime) {
   if (!connection_.support_multiple_connection_ids() ||
-      !connection_.use_connection_id_on_default_path()) {
+      !connection_.use_connection_id_on_default_path() ||
+      !connection_.use_path_validator()) {
     return;
   }
   QuicConnectionPeer::EnableConnectionMigrationUseNewCID(&connection_);
diff --git a/quic/core/quic_flags_list.h b/quic/core/quic_flags_list.h
index 4c2fcd1..19a9fe6 100644
--- a/quic/core/quic_flags_list.h
+++ b/quic/core/quic_flags_list.h
@@ -34,7 +34,6 @@
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_version_q050, false)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_version_t051, false)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_discard_initial_packet_with_key_dropped, true)
-QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_do_not_synthesize_source_cid_for_short_header, true)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_donot_pto_half_rtt_data, false)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_donot_reset_ideal_next_packet_send_time, false)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_donot_write_mid_packet_processing, true)
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc
index 401100a..1b5db82 100644
--- a/quic/core/quic_framer.cc
+++ b/quic/core/quic_framer.cc
@@ -435,10 +435,6 @@
   version_ = supported_versions_[0];
   QUICHE_DCHECK(version_.IsKnown())
       << ParsedQuicVersionVectorToString(supported_versions_);
-  if (do_not_synthesize_source_cid_for_short_header_) {
-    QUIC_RELOADABLE_FLAG_COUNT_N(
-        quic_do_not_synthesize_source_cid_for_short_header, 1, 3);
-  }
 }
 
 QuicFramer::~QuicFramer() {}
@@ -2774,7 +2770,6 @@
 
 bool QuicFramer::ValidateReceivedConnectionIds(const QuicPacketHeader& header) {
   bool skip_server_connection_id_validation =
-      do_not_synthesize_source_cid_for_short_header_ &&
       perspective_ == Perspective::IS_CLIENT &&
       header.form == IETF_QUIC_SHORT_HEADER_PACKET;
   if (!skip_server_connection_id_validation &&
@@ -2786,13 +2781,8 @@
   }
 
   bool skip_client_connection_id_validation =
-      do_not_synthesize_source_cid_for_short_header_ &&
       perspective_ == Perspective::IS_SERVER &&
       header.form == IETF_QUIC_SHORT_HEADER_PACKET;
-  if (skip_client_connection_id_validation) {
-    QUIC_RELOADABLE_FLAG_COUNT_N(
-        quic_do_not_synthesize_source_cid_for_short_header, 2, 3);
-  }
   if (!skip_client_connection_id_validation &&
       version_.SupportsClientConnectionIds() &&
       !QuicUtils::IsConnectionIdValidForVersion(
@@ -2829,15 +2819,6 @@
     header->destination_connection_id_included = CONNECTION_ID_PRESENT;
     header->source_connection_id_included =
         header->version_flag ? CONNECTION_ID_PRESENT : CONNECTION_ID_ABSENT;
-    if (!do_not_synthesize_source_cid_for_short_header_ &&
-        header->source_connection_id_included == CONNECTION_ID_ABSENT) {
-      QUICHE_DCHECK(header->source_connection_id.IsEmpty());
-      if (perspective_ == Perspective::IS_CLIENT) {
-        header->source_connection_id = last_serialized_server_connection_id_;
-      } else {
-        header->source_connection_id = last_serialized_client_connection_id_;
-      }
-    }
 
     if (!ValidateReceivedConnectionIds(*header)) {
       return false;
@@ -2925,13 +2906,6 @@
       set_detailed_error("Client connection ID not supported in this version.");
       return false;
     }
-    if (!do_not_synthesize_source_cid_for_short_header_) {
-      if (perspective_ == Perspective::IS_CLIENT) {
-        header->source_connection_id = last_serialized_server_connection_id_;
-      } else {
-        header->source_connection_id = last_serialized_client_connection_id_;
-      }
-    }
   }
 
   return ValidateReceivedConnectionIds(*header);
diff --git a/quic/core/quic_framer.h b/quic/core/quic_framer.h
index 68eba79..8e67068 100644
--- a/quic/core/quic_framer.h
+++ b/quic/core/quic_framer.h
@@ -714,10 +714,6 @@
     drop_incoming_retry_packets_ = drop_incoming_retry_packets;
   }
 
-  bool do_not_synthesize_source_cid_for_short_header() const {
-    return do_not_synthesize_source_cid_for_short_header_;
-  }
-
  private:
   friend class test::QuicFramerPeer;
 
@@ -1174,11 +1170,6 @@
   // Indicates whether received RETRY packets should be dropped.
   bool drop_incoming_retry_packets_ = false;
 
-  // Indicates whether source connection ID should be synthesized when read
-  // short header packet.
-  const bool do_not_synthesize_source_cid_for_short_header_ =
-      GetQuicReloadableFlag(quic_do_not_synthesize_source_cid_for_short_header);
-
   // The length in bytes of the last packet number written to an IETF-framed
   // packet.
   size_t last_written_packet_number_length_;
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc
index 4bb3b85..91eafc2 100644
--- a/quic/core/quic_framer_test.cc
+++ b/quic/core/quic_framer_test.cc
@@ -1479,9 +1479,6 @@
   ASSERT_TRUE(visitor_.header_.get());
   EXPECT_EQ(FramerTestConnectionId(),
             visitor_.header_->destination_connection_id);
-  if (!framer_.do_not_synthesize_source_cid_for_short_header()) {
-    EXPECT_EQ(TestConnectionId(0x33), visitor_.header_->source_connection_id);
-  }
 }
 
 // In short header packets from client to server, the client connection ID
@@ -1515,9 +1512,6 @@
   ASSERT_TRUE(visitor_.header_.get());
   EXPECT_EQ(FramerTestConnectionId(),
             visitor_.header_->destination_connection_id);
-  if (!framer_.do_not_synthesize_source_cid_for_short_header()) {
-    EXPECT_EQ(TestConnectionId(0x33), visitor_.header_->source_connection_id);
-  }
 }
 
 TEST_P(QuicFramerTest, PacketHeaderWith0ByteConnectionId) {
@@ -1567,9 +1561,6 @@
   EXPECT_FALSE(framer_.ProcessPacket(*encrypted));
   EXPECT_THAT(framer_.error(), IsError(QUIC_MISSING_PAYLOAD));
   ASSERT_TRUE(visitor_.header_.get());
-  if (!framer_.do_not_synthesize_source_cid_for_short_header()) {
-    EXPECT_EQ(FramerTestConnectionId(), visitor_.header_->source_connection_id);
-  }
   EXPECT_FALSE(visitor_.header_->reset_flag);
   EXPECT_FALSE(visitor_.header_->version_flag);
   EXPECT_EQ(kPacketNumber, visitor_.header_->packet_number);