Delete partial message buffering from QBONE Disabling the support has been launched since February. Confirmed that /gfe/gfe2/qbone/connections_with_buffered_partial_messages streamz has been reporting zero since then. Allows some minor cleanup in the packet filter in that without the buffering, we never make any determinations other than boolean allow/deny. Defer/Silent-Drop cases only ever happened with buffering. Also Defer cases no longer happen anywhere in the entire QbonePacketProcessor stack. PiperOrigin-RevId: 628126785
diff --git a/quiche/quic/qbone/qbone_packet_processor.cc b/quiche/quic/qbone/qbone_packet_processor.cc index a4464d4..1ddd02b 100644 --- a/quiche/quic/qbone/qbone_packet_processor.cc +++ b/quiche/quic/qbone/qbone_packet_processor.cc
@@ -13,8 +13,8 @@ #include "absl/base/optimization.h" #include "absl/strings/string_view.h" -#include "quiche/quic/core/internet_checksum.h" #include "quiche/quic/platform/api/quic_bug_tracker.h" +#include "quiche/quic/platform/api/quic_ip_address.h" #include "quiche/quic/platform/api/quic_ip_address_family.h" #include "quiche/quic/platform/api/quic_logging.h" #include "quiche/quic/qbone/platform/icmp_packet.h" @@ -62,8 +62,7 @@ QbonePacketProcessor::Filter::FilterPacket(Direction direction, absl::string_view full_packet, absl::string_view payload, - icmp6_hdr* icmp_header, - OutputInterface* output) { + icmp6_hdr* icmp_header) { return ProcessingResult::OK; } @@ -105,9 +104,6 @@ case ProcessingResult::SILENT_DROP: stats_->OnPacketDroppedSilently(direction, traffic_class); break; - case ProcessingResult::DEFER: - stats_->OnPacketDeferred(direction, traffic_class); - break; case ProcessingResult::ICMP: if (icmp_header.icmp6_type == ICMP6_ECHO_REPLY) { // If this is an ICMP6 ECHO REPLY, the payload should be the same as the @@ -158,7 +154,7 @@ result = filter_->FilterPacket( direction, *packet, absl::string_view(*transport_data, packet->size() - header_size), - icmp_header, output_); + icmp_header); } // Do not send ICMP error messages in response to ICMP errors.
diff --git a/quiche/quic/qbone/qbone_packet_processor.h b/quiche/quic/qbone/qbone_packet_processor.h index e69e09a..9f1030d 100644 --- a/quiche/quic/qbone/qbone_packet_processor.h +++ b/quiche/quic/qbone/qbone_packet_processor.h
@@ -11,9 +11,11 @@ #include <cstddef> #include <cstdint> +#include <memory> +#include <string> +#include <utility> #include "absl/strings/string_view.h" -#include "quiche/quic/core/quic_types.h" #include "quiche/quic/platform/api/quic_ip_address.h" namespace quic { @@ -41,10 +43,6 @@ OK = 0, SILENT_DROP = 1, ICMP = 2, - // Equivalent to |SILENT_DROP| at the moment, but indicates that the - // downstream filter has buffered the packet and deferred its processing. - // The packet may be emitted at a later time. - DEFER = 3, // In addition to sending an ICMP message, also send a TCP RST. This option // requires the incoming packet to have been a valid TCP packet, as a TCP // RST requires information from the current connection state to be @@ -77,8 +75,6 @@ uint8_t traffic_class) = 0; virtual void OnPacketDroppedWithTcpReset(Direction direction, uint8_t traffic_class) = 0; - virtual void OnPacketDeferred(Direction direction, - uint8_t traffic_class) = 0; virtual void RecordThroughput(size_t bytes, Direction direction, uint8_t traffic_class) = 0; }; @@ -98,22 +94,10 @@ // the ICMP message with which the packet is to be rejected. // The method is called only on packets which were already verified as valid // IPv6 packets. - // - // The implementer of this method has four options to return: - // - OK will cause the filter to pass the packet through - // - SILENT_DROP will cause the filter to drop the packet silently - // - ICMP will cause the filter to drop the packet and send an ICMP - // response. - // - DEFER will cause the packet to be not forwarded; the filter is - // responsible for sending (or not sending) it later using |output|. - // - // Note that |output| should not be used except in the DEFER case, as the - // processor will perform the necessary writes itself. virtual ProcessingResult FilterPacket(Direction direction, absl::string_view full_packet, absl::string_view payload, - icmp6_hdr* icmp_header, - OutputInterface* output); + icmp6_hdr* icmp_header); protected: // Helper methods that allow to easily extract information that is required
diff --git a/quiche/quic/qbone/qbone_packet_processor_test.cc b/quiche/quic/qbone/qbone_packet_processor_test.cc index cbb63ed..c35f28c 100644 --- a/quiche/quic/qbone/qbone_packet_processor_test.cc +++ b/quiche/quic/qbone/qbone_packet_processor_test.cc
@@ -318,8 +318,7 @@ class MockPacketFilter : public QbonePacketProcessor::Filter { public: MOCK_METHOD(ProcessingResult, FilterPacket, - (Direction, absl::string_view, absl::string_view, icmp6_hdr*, - OutputInterface*), + (Direction, absl::string_view, absl::string_view, icmp6_hdr*), (override)); }; @@ -429,7 +428,7 @@ TEST_F(QbonePacketProcessorTest, FilterFromClient) { auto filter = std::make_unique<MockPacketFilter>(); - EXPECT_CALL(*filter, FilterPacket(_, _, _, _, _)) + EXPECT_CALL(*filter, FilterPacket(_, _, _, _)) .WillRepeatedly(Return(ProcessingResult::SILENT_DROP)); processor_->set_filter(std::move(filter)); @@ -444,8 +443,7 @@ ProcessingResult FilterPacket(Direction direction, absl::string_view full_packet, absl::string_view payload, - icmp6_hdr* icmp_header, - OutputInterface* output) override { + icmp6_hdr* icmp_header) override { EXPECT_EQ(kIPv6HeaderSize, full_packet.size() - payload.size()); EXPECT_EQ(IPPROTO_UDP, TransportProtocolFromHeader(full_packet)); EXPECT_EQ(client_ip_, SourceIpFromHeader(full_packet)); @@ -508,7 +506,7 @@ TEST_F(QbonePacketProcessorTest, Icmp6EchoResponseHasRightPayload) { auto filter = std::make_unique<MockPacketFilter>(); - EXPECT_CALL(*filter, FilterPacket(_, _, _, _, _)) + EXPECT_CALL(*filter, FilterPacket(_, _, _, _)) .WillOnce(WithArgs<2, 3>( Invoke([](absl::string_view payload, icmp6_hdr* icmp_header) { icmp_header->icmp6_type = ICMP6_ECHO_REPLY;
diff --git a/quiche/quic/qbone/qbone_packet_processor_test_tools.h b/quiche/quic/qbone/qbone_packet_processor_test_tools.h index 619d5ef..970c6c3 100644 --- a/quiche/quic/qbone/qbone_packet_processor_test_tools.h +++ b/quiche/quic/qbone/qbone_packet_processor_test_tools.h
@@ -33,8 +33,6 @@ (QbonePacketProcessor::Direction, uint8_t), (override)); MOCK_METHOD(void, OnPacketDroppedWithTcpReset, (QbonePacketProcessor::Direction, uint8_t), (override)); - MOCK_METHOD(void, OnPacketDeferred, - (QbonePacketProcessor::Direction, uint8_t), (override)); MOCK_METHOD(void, RecordThroughput, (size_t, QbonePacketProcessor::Direction, uint8_t), (override)); };
diff --git a/quiche/quic/qbone/qbone_server_session.h b/quiche/quic/qbone/qbone_server_session.h index 74abad4..7e150fc 100644 --- a/quiche/quic/qbone/qbone_server_session.h +++ b/quiche/quic/qbone/qbone_server_session.h
@@ -69,8 +69,6 @@ uint8_t traffic_class) override {} void OnPacketDroppedWithTcpReset(QbonePacketProcessor::Direction direction, uint8_t traffic_class) override {} - void OnPacketDeferred(QbonePacketProcessor::Direction direction, - uint8_t traffic_class) override {} void RecordThroughput(size_t bytes, QbonePacketProcessor::Direction direction, uint8_t traffic_class) override {}