diff --git a/bazel/external/quiche.BUILD b/bazel/external/quiche.BUILD index b9536fa6dbb32..79575bbe6545a 100644 --- a/bazel/external/quiche.BUILD +++ b/bazel/external/quiche.BUILD @@ -1824,6 +1824,7 @@ envoy_cc_library( ":quic_core_crypto_encryption_lib", ":quic_core_framer_lib", ":quic_core_idle_network_detector_lib", + ":quic_core_legacy_version_encapsulator_lib", ":quic_core_mtu_discovery_lib", ":quic_core_network_blackhole_detector_lib", ":quic_core_one_block_arena_lib", @@ -2192,6 +2193,7 @@ envoy_cc_library( name = "quic_core_frames_frames_lib", srcs = [ "quiche/quic/core/frames/quic_ack_frame.cc", + "quiche/quic/core/frames/quic_ack_frequency_frame.cc", "quiche/quic/core/frames/quic_blocked_frame.cc", "quiche/quic/core/frames/quic_connection_close_frame.cc", "quiche/quic/core/frames/quic_crypto_frame.cc", @@ -2216,6 +2218,7 @@ envoy_cc_library( ], hdrs = [ "quiche/quic/core/frames/quic_ack_frame.h", + "quiche/quic/core/frames/quic_ack_frequency_frame.h", "quiche/quic/core/frames/quic_blocked_frame.h", "quiche/quic/core/frames/quic_connection_close_frame.h", "quiche/quic/core/frames/quic_crypto_frame.h", @@ -2567,6 +2570,29 @@ envoy_cc_library( ], ) +envoy_cc_library( + name = "quic_core_legacy_version_encapsulator_lib", + srcs = [ + "quiche/quic/core/quic_legacy_version_encapsulator.cc", + ], + hdrs = [ + "quiche/quic/core/quic_legacy_version_encapsulator.h", + ], + copts = quiche_copts, + repository = "@envoy", + tags = ["nofips"], + deps = [ + ":quic_core_crypto_crypto_handshake_lib", + ":quic_core_crypto_encryption_lib", + ":quic_core_packet_creator_lib", + ":quic_core_packets_lib", + ":quic_core_types_lib", + ":quic_core_utils_lib", + ":quic_platform", + ":quiche_common_platform", + ], +) + envoy_cc_library( name = "quic_core_linux_socket_utils_lib", srcs = select({ diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index b2501eca906f9..9be79fe4bf882 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -411,9 +411,9 @@ DEPENDENCY_REPOSITORIES = dict( cpe = "N/A", ), com_googlesource_quiche = dict( - # Static snapshot of https://quiche.googlesource.com/quiche/+archive/d88a2f7a9ff5f9f6be2f50411b15b091affe04d3.tar.gz - sha256 = "c1c5dc165f0509097fa3917d81988e4ac5f9f3da4c2361ee435dfa7f8f428016", - urls = ["https://storage.googleapis.com/quiche-envoy-integration/d88a2f7a9ff5f9f6be2f50411b15b091affe04d3.tar.gz"], + # Static snapshot of https://quiche.googlesource.com/quiche/+archive/b2b8ff25f5a565324b93411ca29c3403ccbca969.tar.gz + sha256 = "792924bbf27203bb0d1d08c99597a30793ef8f4cfa2df99792aea7200f1b27e3", + urls = ["https://storage.googleapis.com/quiche-envoy-integration/b2b8ff25f5a565324b93411ca29c3403ccbca969.tar.gz"], use_category = ["dataplane"], cpe = "N/A", ), diff --git a/source/extensions/quic_listeners/quiche/platform/flags_list.h b/source/extensions/quic_listeners/quiche/platform/flags_list.h index 9ced2934b27fa..776521f42d0d4 100644 --- a/source/extensions/quic_listeners/quiche/platform/flags_list.h +++ b/source/extensions/quic_listeners/quiche/platform/flags_list.h @@ -8,6 +8,9 @@ // consumed or referenced directly by other Envoy code. It serves purely as a // porting layer for QUICHE. +// This file is generated by //third_party/quic/tools:quic_flags_list in +// Google3. + #if defined(QUICHE_FLAG) QUICHE_FLAG( @@ -32,9 +35,6 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_ack_delay_alarm_granularity, false, "When true, ensure the ACK delay is never less than the alarm granularity when ACK " "decimation is enabled.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_advance_ack_timeout_update, true, - "If true, update ack timeout upon receiving an retransmittable frame.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_allow_backend_set_stream_ttl, false, "If true, check backend response header for X-Response-Ttl. If it is provided, the " "stream TTL is set. A QUIC stream will be immediately canceled when tries to write " @@ -50,7 +50,7 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_always_send_earliest_ack, false, "If true, SendAllPendingAcks always send the earliest ACK.") QUICHE_FLAG( - bool, quic_reloadable_flag_quic_avoid_leak_writer_buffer, false, + bool, quic_reloadable_flag_quic_avoid_leak_writer_buffer, true, "If true, QUIC will free writer-allocated packet buffer if writer->WritePacket is not called.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr2_add_ack_height_to_queueing_threshold, true, @@ -71,9 +71,6 @@ QUICHE_FLAG( bool, quic_reloadable_flag_quic_bbr2_limit_inflight_hi, false, "When true, the B2HI connection option limits reduction of inflight_hi to (1-Beta)*CWND.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr_default_exit_startup_on_loss, true, - "If true, QUIC will enable connection options LRTT+BBQ2 by default.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr_donot_inject_bandwidth, true, "If true, do not inject bandwidth in BbrSender::AdjustNetworkParameters.") @@ -95,16 +92,13 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_bbr_no_bytes_acked_in_startup_recove QUICHE_FLAG(bool, quic_reloadable_flag_quic_bootstrap_cwnd_by_spdy_priority, true, "If true, bootstrap initial QUIC cwnd by SPDY priorities.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_bw_sampler_app_limited_starting_value, true, - "If true, quic::BandwidthSampler will start in application limited phase.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_conservative_bursts, false, "If true, set burst token to 2 in cwnd bootstrapping experiment.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_conservative_cwnd_and_pacing_gains, false, "If true, uses conservative cwnd gain and pacing gain when cwnd gets bootstrapped.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_default_enable_5rto_blackhole_detection2, false, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_default_enable_5rto_blackhole_detection2, true, "If true, default-enable 5RTO blachole detection.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_default_on_pto, false, @@ -117,16 +111,25 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_default_to_bbr_v2, false, "If true, use BBRv2 as the default congestion controller. Takes precedence over " "--quic_default_to_bbr.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_determine_serialized_packet_fate_early, false, + "If true, determine a serialized packet's fate before the packet gets serialized.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_draft_25, false, + "If true, disable QUIC version h3-25.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_draft_27, false, + "If true, disable QUIC version h3-27.") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_q043, false, "If true, disable QUIC version Q043.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_q046, false, "If true, disable QUIC version Q046.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_q048, false, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_q048, true, "If true, disable QUIC version Q048.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_q049, false, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_q049, true, "If true, disable QUIC version Q049.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_q050, false, @@ -135,16 +138,29 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_q050, false, QUICHE_FLAG(bool, quic_reloadable_flag_quic_disable_version_t050, false, "If true, disable QUIC version h3-T050.") +QUICHE_FLAG( + bool, quic_reloadable_flag_quic_dispatcher_legacy_version_encapsulation, false, + "When true, QuicDispatcher supports decapsulation of Legacy Version Encapsulation packets.") + QUICHE_FLAG( bool, quic_reloadable_flag_quic_do_not_accept_stop_waiting, false, "In v44 and above, where STOP_WAITING is never sent, close the connection if it's received.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_donot_change_queued_ack, false, - "If true, do not change ACK in PostProcessAckFrame if an ACK has been queued.") +QUICHE_FLAG( + bool, quic_reloadable_flag_quic_do_not_close_stream_again_on_connection_close, false, + "If true, do not try to close stream again if stream fails to be closed upon connection close.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_donot_reset_ideal_next_packet_send_time, false, "If true, stop resetting ideal_next_packet_send_time_ in pacing sender.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_dont_pad_chlo, false, + "When true, do not pad the QUIC_CRYPTO CHLO message itself. Note that the packet " + "containing the CHLO will still be padded.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_dont_send_max_ack_delay_if_default, false, + "When true, QUIC_CRYPTO versions of QUIC will not send the max ACK delay unless it is " + "configured to a non-default value.") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_ack_decimation, true, "Default enables QUIC ack decimation and adds a connection option to disable it.") @@ -154,65 +170,55 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_loss_detection_experiment_at_ QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_loss_detection_tuner, false, "If true, allow QUIC loss detection tuning to be enabled by connection option ELDT.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_tls_resumption, false, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_tls_resumption_v2, false, "If true, enables support for TLS resumption in QUIC.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_version_draft_25_v3, true, - "If true, enable QUIC version h3-25.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_version_draft_27, true, - "If true, enable QUIC version h3-27.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_version_draft_28, false, - "If true, enable QUIC version h3-28.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_version_draft_29, false, + "If true, enable QUIC version h3-29.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_enable_zero_rtt_for_tls, false, "If true, support for IETF QUIC 0-rtt is enabled.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_enabled, false, "") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_extend_idle_time_on_decryptable_packets, true, - "If true, only extend idle time on decryptable packets.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_bbr_cwnd_in_bandwidth_resumption, true, "If true, adjust congestion window when doing bandwidth resumption in BBR.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_checking_should_generate_packet, false, - "If true, check ShouldGeneratePacket for every crypto packet.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_extra_padding_bytes, false, + "If true, consider frame expansion when calculating extra padding bytes to meet " + "minimum plaintext packet size required for header protection.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_last_inflight_packets_sent_time, false, - "If true, clear last_inflight_packets_sent_time_ of a packet number space when there " - "is no bytes in flight.") +QUICHE_FLAG( + bool, quic_reloadable_flag_quic_fix_gquic_stream_type, false, + "If true, do not use QuicUtil::IsBidirectionalStreamId() to determine gQUIC stream type.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_server_pto_timeout, false, - "If true, do not arm PTO on half RTT packets if they are the only ones in flight.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_min_crypto_frame_size, true, + "If true, include MinPlaintextPacketSize when deterine whether removing soft limit for " + "crypto frames.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_willing_and_able_to_write, false, - "If true, check connection level flow control for send control stream and qpack " - "streams in QuicSession::WillingAndAbleToWrite.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_packet_number_length, false, + "If true, take the largest acked packet into account when computing the sent packet " + "number length.") -QUICHE_FLAG( - bool, quic_reloadable_flag_quic_fix_write_pending_crypto_retransmission, false, - "If true, return from QuicCryptoStream::WritePendingCryptoRetransmission after partial writes.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_pto_timeout, true, + "If true, use 0 as ack_delay when calculate PTO timeout for INITIAL and HANDSHAKE " + "packet number space.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_server_pto_timeout, true, + "If true, do not arm PTO on half RTT packets if they are the only ones in flight.") + +QUICHE_FLAG(bool, quic_reloadable_flag_quic_fix_undecryptable_packets, false, + "If true, remove the head of line blocking caused by an unprocessable packet in the " + "undecryptable packets list.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_listener_never_fake_epollout, false, "If true, QuicListener::OnSocketIsWritable will always return false, which means there " "will never be a fake EPOLLOUT event in the next epoll iteration.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_move_amplification_limit, false, - "When true, always check the amplification limit before writing, not just for " - "handshake packets.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_negotiate_ack_delay_time, true, - "If true, will negotiate the ACK delay time.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_no_dup_experiment_id_2, false, "If true, transport connection stats doesn't report duplicated experiments for same " "connection.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_notify_stream_id_manager_when_disconnected, false, - "If true, notify stream ID manager even connection disconnects.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_only_truncate_long_cids, true, "In IETF QUIC, only truncate long CIDs from the client's Initial, don't modify them.") @@ -230,49 +236,42 @@ QUICHE_FLAG(bool, quic_reloadable_flag_quic_require_handshake_confirmation, fals "If true, require handshake confirmation for QUIC connections, functionally disabling " "0-rtt handshakes.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_save_user_agent_in_quic_session, false, + "If true, save user agent into in QuicSession.") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_send_timestamps, false, "When the STMP connection option is sent by the client, timestamps in the QUIC ACK " "frame are sent and processed.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_send_two_alt_addresses, true, - "When true, GFE will send two AlternateServerAddress (IPv6+IPv4) instead of one.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_server_push, true, "If true, enable server push feature on QUIC.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_stop_sending_duplicate_max_streams, false, "If true, session does not send duplicate MAX_STREAMS.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_support_handshake_done_in_t050, false, + "If true, support HANDSHAKE_DONE frame in T050.") + QUICHE_FLAG(bool, quic_reloadable_flag_quic_testonly_default_false, false, "A testonly reloadable flag that will always default to false.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_testonly_default_true, true, "A testonly reloadable flag that will always default to true.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_tls_enforce_valid_sni, false, - "If true, reject IETF QUIC connections with invalid SNI.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_unified_iw_options, false, "When true, set the initial congestion control window from connection options in " "QuicSentPacketManager rather than TcpCubicSenderBytes.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_update_ack_alarm_in_send_all_pending_acks, false, - "If true, QuicConnection::SendAllPendingAcks will Update instead of Set the ack alarm.") +QUICHE_FLAG(bool, quic_reloadable_flag_quic_update_packet_size, false, + "If true, update packet size when the first frame gets queued.") -QUICHE_FLAG(bool, quic_reloadable_flag_quic_use_dispatcher_clock_for_read_timestamp, false, +QUICHE_FLAG(bool, quic_reloadable_flag_quic_use_dispatcher_clock_for_read_timestamp, true, "If true, in QuicListener, use QuicDispatcher's clock as the source for packet read " "timestamps.") QUICHE_FLAG(bool, quic_reloadable_flag_quic_use_header_stage_idle_list2, false, "If true, use header stage idle list for QUIC connections in GFE.") -QUICHE_FLAG( - bool, quic_reloadable_flag_quic_use_idle_network_detector, false, - "If true, use idle network detector to detect handshake timeout and idle network timeout.") - -QUICHE_FLAG(bool, quic_reloadable_flag_quic_use_ip_bandwidth_module, true, - "If true, use IpBandwidthModule for cwnd bootstrapping if it is registered.") - QUICHE_FLAG(bool, quic_reloadable_flag_quic_use_leto_key_exchange, false, "If true, QUIC will attempt to use the Leto key exchange service and only fall back to " "local key exchange if that fails.") @@ -295,28 +294,22 @@ QUICHE_FLAG( bool, quic_restart_flag_quic_allow_loas_multipacket_chlo, false, "If true, inspects QUIC CHLOs for kLOAS and early creates sessions to allow multi-packet CHLOs") +QUICHE_FLAG(bool, quic_restart_flag_quic_dispatcher_track_top_1k_client_ip, true, + "If true, GfeQuicDispatcher will track the top 1000 client IPs.") + QUICHE_FLAG(bool, quic_restart_flag_quic_google_transport_param_omit_old, false, "When true, QUIC+TLS will not send nor parse the old-format Google-specific transport " "parameters.") -QUICHE_FLAG( - bool, quic_restart_flag_quic_google_transport_param_send_new, false, - "When true, QUIC+TLS will send and parse the new-format Google-specific transport parameters.") +QUICHE_FLAG(bool, quic_restart_flag_quic_ignore_cid_first_byte_in_rx_ring_bpf, true, + "If true, ignore CID first byte in BPF for RX_RING.") -QUICHE_FLAG(bool, quic_restart_flag_quic_ignore_cid_first_byte_in_bpf, false, - "If true, ignore CID first byte in BPF for both UDP socket and RX_RING.") +QUICHE_FLAG(bool, quic_restart_flag_quic_memslice_ensure_ownership, true, + "Call gfe2::MemSlice::EnsureReferenceCounted in the constructor of QuicMemSlice.") QUICHE_FLAG(bool, quic_restart_flag_quic_offload_pacing_to_usps2, false, "If true, QUIC offload pacing when using USPS as egress method.") -QUICHE_FLAG(bool, quic_restart_flag_quic_replace_gfe_connection_ids, false, - "When true, GfeQuicDispatcher will replace long connection IDs with 64bit ones before " - "inserting them in the connection map.") - -QUICHE_FLAG(bool, quic_restart_flag_quic_replace_time_wait_list_encryption_level, false, - "Replace the usage of ConnectionData::encryption_level in quic_time_wait_list_manager " - "with a new TimeWaitAction.") - QUICHE_FLAG(bool, quic_restart_flag_quic_rx_ring_use_tpacket_v3, false, "If true, use TPACKET_V3 for QuicRxRing instead of TPACKET_V2.") @@ -341,7 +334,7 @@ QUICHE_FLAG(bool, quic_restart_flag_quic_use_pigeon_socket_to_backend, false, "If true, create a shared pigeon socket for all quic to backend connections and switch " "to use it after successful handshake.") -QUICHE_FLAG(bool, spdy_reloadable_flag_fix_spdy_header_coalescing, false, +QUICHE_FLAG(bool, spdy_reloadable_flag_fix_spdy_header_coalescing, true, "If true, when coalescing multivalued spdy headers, only headers that exist in spdy " "headers block are updated.") @@ -366,8 +359,8 @@ QUICHE_FLAG(bool, quic_enforce_single_packet_chlo, true, "If true, enforce that QUIC CHLOs fit in one packet") QUICHE_FLAG(int64_t, quic_time_wait_list_max_connections, 600000, - "Maximum number of connections on the time-wait list. A negative value implies no " - "configured limit.") + "Maximum number of connections on the time-wait list. " + "A negative value implies no configured limit.") QUICHE_FLAG(int64_t, quic_time_wait_list_seconds, 200, "Time period for which a given connection_id should live in " @@ -452,7 +445,7 @@ QUICHE_FLAG(double, quic_ack_aggregation_bandwidth_threshold, 1.0, "bandwidth * this flag), consider the current aggregation completed " "and starts a new one.") -QUICHE_FLAG(int32_t, quic_anti_amplification_factor, 3, +QUICHE_FLAG(int32_t, quic_anti_amplification_factor, 5, "Anti-amplification factor. Before address validation, server will " "send no more than factor times bytes received.") diff --git a/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc b/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc index fb644bd68df95..cc9ef16f2abfc 100644 --- a/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc +++ b/test/extensions/quic_listeners/quiche/active_quic_listener_test.cc @@ -84,9 +84,9 @@ class ActiveQuicListenerTest : public QuicMultiVersionTest { return quic::CurrentSupportedVersionsWithQuicCrypto(); } bool use_http3 = GetParam().second == QuicVersionType::Iquic; - SetQuicReloadableFlag(quic_enable_version_draft_28, use_http3); - SetQuicReloadableFlag(quic_enable_version_draft_27, use_http3); - SetQuicReloadableFlag(quic_enable_version_draft_25_v3, use_http3); + SetQuicReloadableFlag(quic_enable_version_draft_29, use_http3); + SetQuicReloadableFlag(quic_disable_version_draft_27, !use_http3); + SetQuicReloadableFlag(quic_disable_version_draft_25, !use_http3); return quic::CurrentSupportedVersions(); }()[0]) {} diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_client_session_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_client_session_test.cc index 5707ae2dbfca0..5db43230cd7cc 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_client_session_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_client_session_test.cc @@ -95,9 +95,9 @@ class EnvoyQuicClientSessionTest : public testing::TestWithParam { : api_(Api::createApiForTest(time_system_)), dispatcher_(api_->allocateDispatcher("test_thread")), connection_helper_(*dispatcher_), alarm_factory_(*dispatcher_, *connection_helper_.GetClock()), quic_version_([]() { - SetQuicReloadableFlag(quic_enable_version_draft_28, GetParam()); - SetQuicReloadableFlag(quic_enable_version_draft_27, GetParam()); - SetQuicReloadableFlag(quic_enable_version_draft_25_v3, GetParam()); + SetQuicReloadableFlag(quic_enable_version_draft_29, GetParam()); + SetQuicReloadableFlag(quic_disable_version_draft_27, !GetParam()); + SetQuicReloadableFlag(quic_disable_version_draft_25, !GetParam()); return quic::ParsedVersionOfIndex(quic::CurrentSupportedVersions(), 0); }()), peer_addr_(Network::Utility::getAddressWithPort(*Network::Utility::getIpv6LoopbackAddress(), diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_client_stream_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_client_stream_test.cc index 120fc7d83b358..2a32df6319edc 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_client_stream_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_client_stream_test.cc @@ -25,9 +25,9 @@ class EnvoyQuicClientStreamTest : public testing::TestWithParam { : api_(Api::createApiForTest()), dispatcher_(api_->allocateDispatcher("test_thread")), connection_helper_(*dispatcher_), alarm_factory_(*dispatcher_, *connection_helper_.GetClock()), quic_version_([]() { - SetQuicReloadableFlag(quic_enable_version_draft_28, GetParam()); - SetQuicReloadableFlag(quic_enable_version_draft_27, GetParam()); - SetQuicReloadableFlag(quic_enable_version_draft_25_v3, GetParam()); + SetQuicReloadableFlag(quic_enable_version_draft_29, GetParam()); + SetQuicReloadableFlag(quic_disable_version_draft_27, !GetParam()); + SetQuicReloadableFlag(quic_disable_version_draft_25, !GetParam()); return quic::CurrentSupportedVersions()[0]; }()), peer_addr_(Network::Utility::getAddressWithPort(*Network::Utility::getIpv6LoopbackAddress(), diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_dispatcher_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_dispatcher_test.cc index 07f0365716781..7036935c5a679 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_dispatcher_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_dispatcher_test.cc @@ -63,9 +63,9 @@ class EnvoyQuicDispatcherTest : public QuicMultiVersionTest, return quic::CurrentSupportedVersionsWithQuicCrypto(); } bool use_http3 = GetParam().second == QuicVersionType::Iquic; - SetQuicReloadableFlag(quic_enable_version_draft_28, use_http3); - SetQuicReloadableFlag(quic_enable_version_draft_27, use_http3); - SetQuicReloadableFlag(quic_enable_version_draft_25_v3, use_http3); + SetQuicReloadableFlag(quic_enable_version_draft_29, use_http3); + SetQuicReloadableFlag(quic_disable_version_draft_27, !use_http3); + SetQuicReloadableFlag(quic_disable_version_draft_25, !use_http3); return quic::CurrentSupportedVersions(); }()), quic_version_(version_manager_.GetSupportedVersions()[0]), diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_server_session_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_server_session_test.cc index df0d61491990c..28e04399b8c73 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_server_session_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_server_session_test.cc @@ -103,9 +103,9 @@ class EnvoyQuicServerSessionTest : public testing::TestWithParam { : api_(Api::createApiForTest(time_system_)), dispatcher_(api_->allocateDispatcher("test_thread")), connection_helper_(*dispatcher_), alarm_factory_(*dispatcher_, *connection_helper_.GetClock()), quic_version_([]() { - SetQuicReloadableFlag(quic_enable_version_draft_28, GetParam()); - SetQuicReloadableFlag(quic_enable_version_draft_27, GetParam()); - SetQuicReloadableFlag(quic_enable_version_draft_25_v3, GetParam()); + SetQuicReloadableFlag(quic_enable_version_draft_29, GetParam()); + SetQuicReloadableFlag(quic_disable_version_draft_27, !GetParam()); + SetQuicReloadableFlag(quic_disable_version_draft_25, !GetParam()); return quic::ParsedVersionOfIndex(quic::CurrentSupportedVersions(), 0); }()), listener_stats_({ALL_LISTENER_STATS(POOL_COUNTER(listener_config_.listenerScope()), @@ -143,6 +143,7 @@ class EnvoyQuicServerSessionTest : public testing::TestWithParam { envoy_quic_session_.Initialize(); setQuicConfigWithDefaultValues(envoy_quic_session_.config()); envoy_quic_session_.OnConfigNegotiated(); + quic::test::QuicConnectionPeer::SetAddressValidated(quic_connection_); // Switch to a encryption forward secure crypto stream. quic::test::QuicServerSessionBasePeer::SetCryptoStream(&envoy_quic_session_, nullptr); diff --git a/test/extensions/quic_listeners/quiche/envoy_quic_server_stream_test.cc b/test/extensions/quic_listeners/quiche/envoy_quic_server_stream_test.cc index 240a80cdf05e5..9cfecf56bbe50 100644 --- a/test/extensions/quic_listeners/quiche/envoy_quic_server_stream_test.cc +++ b/test/extensions/quic_listeners/quiche/envoy_quic_server_stream_test.cc @@ -1,5 +1,14 @@ #include +#pragma GCC diagnostic push +// QUICHE allows unused parameters. +#pragma GCC diagnostic ignored "-Wunused-parameter" +// QUICHE uses offsetof(). +#pragma GCC diagnostic ignored "-Winvalid-offsetof" + +#include "quiche/quic/test_tools/quic_connection_peer.h" +#pragma GCC diagnostic pop + #include "common/event/libevent_scheduler.h" #include "common/http/headers.h" @@ -30,9 +39,9 @@ class EnvoyQuicServerStreamTest : public testing::TestWithParam { : api_(Api::createApiForTest()), dispatcher_(api_->allocateDispatcher("test_thread")), connection_helper_(*dispatcher_), alarm_factory_(*dispatcher_, *connection_helper_.GetClock()), quic_version_([]() { - SetQuicReloadableFlag(quic_enable_version_draft_28, GetParam()); - SetQuicReloadableFlag(quic_enable_version_draft_27, GetParam()); - SetQuicReloadableFlag(quic_enable_version_draft_25_v3, GetParam()); + SetQuicReloadableFlag(quic_enable_version_draft_29, GetParam()); + SetQuicReloadableFlag(quic_disable_version_draft_27, !GetParam()); + SetQuicReloadableFlag(quic_disable_version_draft_25, !GetParam()); return quic::CurrentSupportedVersions()[0]; }()), listener_stats_({ALL_LISTENER_STATS(POOL_COUNTER(listener_config_.listenerScope()), @@ -51,6 +60,7 @@ class EnvoyQuicServerStreamTest : public testing::TestWithParam { response_trailers_{{"trailer-key", "trailer-value"}} { quic_stream_->setRequestDecoder(stream_decoder_); quic_stream_->addCallbacks(stream_callbacks_); + quic::test::QuicConnectionPeer::SetAddressValidated(&quic_connection_); quic_session_.ActivateStream(std::unique_ptr(quic_stream_)); EXPECT_CALL(quic_session_, ShouldYield(_)).WillRepeatedly(testing::Return(false)); EXPECT_CALL(quic_session_, WritevData(_, _, _, _, _, _)) diff --git a/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc b/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc index dd9092be7e890..bbe34b658e7b3 100644 --- a/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc +++ b/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc @@ -54,9 +54,9 @@ class QuicHttpIntegrationTest : public HttpIntegrationTest, public QuicMultiVers return quic::CurrentSupportedVersionsWithQuicCrypto(); } bool use_http3 = GetParam().second == QuicVersionType::Iquic; - SetQuicReloadableFlag(quic_enable_version_draft_28, use_http3); - SetQuicReloadableFlag(quic_enable_version_draft_27, use_http3); - SetQuicReloadableFlag(quic_enable_version_draft_25_v3, use_http3); + SetQuicReloadableFlag(quic_enable_version_draft_29, use_http3); + SetQuicReloadableFlag(quic_disable_version_draft_27, !use_http3); + SetQuicReloadableFlag(quic_disable_version_draft_25, !use_http3); return quic::CurrentSupportedVersions(); }()), crypto_config_(std::make_unique()), conn_helper_(*dispatcher_), @@ -77,7 +77,7 @@ class QuicHttpIntegrationTest : public HttpIntegrationTest, public QuicMultiVers // TODO(danzh) Implement retry upon version mismatch and modify test frame work to specify a // different version set on server side to test that. auto connection = std::make_unique( - getNextServerDesignatedConnectionId(), server_addr_, conn_helper_, alarm_factory_, + getNextConnectionId(), server_addr_, conn_helper_, alarm_factory_, quic::ParsedQuicVersionVector{supported_versions_[0]}, local_addr, *dispatcher_, nullptr); quic_connection_ = connection.get(); auto session = std::make_unique( @@ -107,14 +107,13 @@ class QuicHttpIntegrationTest : public HttpIntegrationTest, public QuicMultiVers return codec; } - quic::QuicConnectionId getNextServerDesignatedConnectionId() { - quic::QuicCryptoClientConfig::CachedState* cached = crypto_config_.LookupOrCreate(server_id_); - // If the cached state indicates that we should use a server-designated - // connection ID, then return that connection ID. - quic::QuicConnectionId conn_id = cached->has_server_designated_connection_id() - ? cached->GetNextServerDesignatedConnectionId() - : quic::EmptyQuicConnectionId(); - return conn_id.IsEmpty() ? quic::QuicUtils::CreateRandomConnectionId() : conn_id; + quic::QuicConnectionId getNextConnectionId() { + if (designated_connection_ids_.empty()) { + return quic::QuicUtils::CreateRandomConnectionId(); + } + quic::QuicConnectionId cid = designated_connection_ids_.front(); + designated_connection_ids_.pop_front(); + return cid; } void initialize() override { @@ -189,6 +188,7 @@ class QuicHttpIntegrationTest : public HttpIntegrationTest, public QuicMultiVers bool set_reuse_port_{false}; const std::string injected_resource_filename_; AtomicFileUpdater file_updater_; + std::list designated_connection_ids_; }; INSTANTIATE_TEST_SUITE_P(QuicHttpIntegrationTests, QuicHttpIntegrationTest, @@ -290,13 +290,12 @@ TEST_P(QuicHttpIntegrationTest, MultipleQuicListenersWithBPF) { set_reuse_port_ = true; initialize(); std::vector codec_clients; - quic::QuicCryptoClientConfig::CachedState* cached = crypto_config_.LookupOrCreate(server_id_); for (size_t i = 1; i <= concurrency_; ++i) { // The BPF filter looks at the 1st word of connection id in the packet // header. And currently all QUIC versions support 8 bytes connection id. So // create connections with the first 4 bytes of connection id different from each // other so they should be evenly distributed. - cached->add_server_designated_connection_id(quic::test::TestConnectionId(i << 32)); + designated_connection_ids_.push_back(quic::test::TestConnectionId(i << 32)); codec_clients.push_back(makeHttpConnection(lookupPort("http"))); } if (GetParam().first == Network::Address::IpVersion::v4) { @@ -333,13 +332,12 @@ TEST_P(QuicHttpIntegrationTest, MultipleQuicListenersNoBPF) { #undef SO_ATTACH_REUSEPORT_CBPF #endif std::vector codec_clients; - quic::QuicCryptoClientConfig::CachedState* cached = crypto_config_.LookupOrCreate(server_id_); for (size_t i = 1; i <= concurrency_; ++i) { // The BPF filter looks at the 1st byte of connection id in the packet // header. And currently all QUIC versions support 8 bytes connection id. So // create connections with the first 4 bytes of connection id different from each // other so they should be evenly distributed. - cached->add_server_designated_connection_id(quic::test::TestConnectionId(i << 32)); + designated_connection_ids_.push_back(quic::test::TestConnectionId(i << 32)); codec_clients.push_back(makeHttpConnection(lookupPort("http"))); } if (GetParam().first == Network::Address::IpVersion::v4) {