Deprecate quic_drop_invalid_flags

This CL deprecates gfe2_restart_flag_quic_drop_invalid_flags.

PiperOrigin-RevId: 400798420
diff --git a/quic/core/quic_dispatcher_test.cc b/quic/core/quic_dispatcher_test.cc
index 4fc2a93..2180962 100644
--- a/quic/core/quic_dispatcher_test.cc
+++ b/quic/core/quic_dispatcher_test.cc
@@ -957,13 +957,8 @@
       .Times(0);
   EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _))
       .Times(0);
-  if (GetQuicRestartFlag(quic_drop_invalid_flags)) {
-    EXPECT_CALL(*time_wait_list_manager_, SendPublicReset(_, _, _, _, _, _))
-        .Times(0);
-  } else {
-    EXPECT_CALL(*time_wait_list_manager_, SendPublicReset(_, _, _, _, _, _))
-        .Times(1);
-  }
+  EXPECT_CALL(*time_wait_list_manager_, SendPublicReset(_, _, _, _, _, _))
+      .Times(0);
   dispatcher_->ProcessPacket(server_address_, client_address, packet);
 }
 
diff --git a/quic/core/quic_flags_list.h b/quic/core/quic_flags_list.h
index d7e9676..f1784a0 100644
--- a/quic/core/quic_flags_list.h
+++ b/quic/core/quic_flags_list.h
@@ -121,8 +121,6 @@
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_send_timestamps, false)
 // When the flag is true, exit STARTUP after the same number of loss events as PROBE_UP.
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_bbr2_startup_probe_up_loss_events, true)
-// When true, QuicDispatcher will silently drop QUIC packets that have invalid flags.
-QUIC_FLAG(FLAGS_quic_restart_flag_quic_drop_invalid_flags, true)
 // When true, QuicDispatcher will silently drop incoming packets whose UDP source port is on the blocklist.
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_blocked_ports, false)
 // When true, defaults to BBR congestion control instead of Cubic.
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc
index 6980783..4e0f639 100644
--- a/quic/core/quic_framer.cc
+++ b/quic/core/quic_framer.cc
@@ -6608,26 +6608,23 @@
     return QUIC_INVALID_PACKET_HEADER;
   }
   const uint8_t first_byte = reader.PeekByte();
-  if (GetQuicRestartFlag(quic_drop_invalid_flags)) {
-    QUIC_RESTART_FLAG_COUNT(quic_drop_invalid_flags);
-    if ((first_byte & FLAGS_LONG_HEADER) == 0 &&
-        (first_byte & FLAGS_FIXED_BIT) == 0 &&
-        (first_byte & FLAGS_DEMULTIPLEXING_BIT) == 0) {
-      // All versions of Google QUIC up to and including Q043 set
-      // FLAGS_DEMULTIPLEXING_BIT to one on all client-to-server packets. Q044
-      // and Q045 were never default-enabled in production. All subsequent
-      // versions of Google QUIC (starting with Q046) require FLAGS_FIXED_BIT to
-      // be set to one on all packets. All versions of IETF QUIC (since
-      // draft-ietf-quic-transport-17 which was earlier than the first IETF QUIC
-      // version that was deployed in production by any implementation) also
-      // require FLAGS_FIXED_BIT to be set to one on all packets. If a packet
-      // has the FLAGS_LONG_HEADER bit set to one, it could be a first flight
-      // from an unknown future version that allows the other two bits to be set
-      // to zero. Based on this, packets that have all three of those bits set
-      // to zero are known to be invalid.
-      *detailed_error = "Invalid flags.";
-      return QUIC_INVALID_PACKET_HEADER;
-    }
+  if ((first_byte & FLAGS_LONG_HEADER) == 0 &&
+      (first_byte & FLAGS_FIXED_BIT) == 0 &&
+      (first_byte & FLAGS_DEMULTIPLEXING_BIT) == 0) {
+    // All versions of Google QUIC up to and including Q043 set
+    // FLAGS_DEMULTIPLEXING_BIT to one on all client-to-server packets. Q044
+    // and Q045 were never default-enabled in production. All subsequent
+    // versions of Google QUIC (starting with Q046) require FLAGS_FIXED_BIT to
+    // be set to one on all packets. All versions of IETF QUIC (since
+    // draft-ietf-quic-transport-17 which was earlier than the first IETF QUIC
+    // version that was deployed in production by any implementation) also
+    // require FLAGS_FIXED_BIT to be set to one on all packets. If a packet
+    // has the FLAGS_LONG_HEADER bit set to one, it could be a first flight
+    // from an unknown future version that allows the other two bits to be set
+    // to zero. Based on this, packets that have all three of those bits set
+    // to zero are known to be invalid.
+    *detailed_error = "Invalid flags.";
+    return QUIC_INVALID_PACKET_HEADER;
   }
   const bool ietf_format = QuicUtils::IsIetfPacketHeader(first_byte);
   uint8_t unused_first_byte;
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc
index 3e12940..f630867 100644
--- a/quic/core/quic_framer_test.cc
+++ b/quic/core/quic_framer_test.cc
@@ -1304,7 +1304,6 @@
 }
 
 TEST_P(QuicFramerTest, AllZeroPacketParsingFails) {
-  SetQuicRestartFlag(quic_drop_invalid_flags, true);
   unsigned char packet[1200] = {};
   QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
   PacketHeaderFormat format = GOOGLE_QUIC_PACKET;