Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1387)

Unified Diff: net/tools/quic/quic_packet_reader.cc

Issue 1543703002: Drop packets which are larger than kMaxPacketSize, instead of closing the connection with QUIC_PACK… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110286048
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_packet_reader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_packet_reader.cc
diff --git a/net/tools/quic/quic_packet_reader.cc b/net/tools/quic/quic_packet_reader.cc
index 90f058708ca22807ff354c074bfc9618747ba3b6..66c229d2fd8804b7c105364e05471dd80273cb1e 100644
--- a/net/tools/quic/quic_packet_reader.cc
+++ b/net/tools/quic/quic_packet_reader.cc
@@ -40,8 +40,8 @@ void QuicPacketReader::Initialize() {
memset(mmsg_hdr_, 0, sizeof(mmsg_hdr_));
for (int i = 0; i < kNumPacketsPerReadMmsgCall; ++i) {
- iov_[i].iov_base = buf_ + (2 * kMaxPacketSize * i);
- iov_[i].iov_len = 2 * kMaxPacketSize;
+ iov_[i].iov_base = buf_ + (kMaxPacketSize * i);
+ iov_[i].iov_len = kMaxPacketSize;
msghdr* hdr = &mmsg_hdr_[i].msg_hdr;
hdr->msg_name = &raw_address_[i];
@@ -65,7 +65,7 @@ bool QuicPacketReader::ReadAndDispatchPackets(
#if MMSG_MORE
// Re-set the length fields in case recvmmsg has changed them.
for (int i = 0; i < kNumPacketsPerReadMmsgCall; ++i) {
- iov_[i].iov_len = 2 * kMaxPacketSize;
+ iov_[i].iov_len = kMaxPacketSize;
mmsg_hdr_[i].msg_len = 0;
msghdr* hdr = &mmsg_hdr_[i].msg_hdr;
hdr->msg_namelen = sizeof(sockaddr_storage);
@@ -118,9 +118,7 @@ bool QuicPacketReader::ReadAndDispatchSinglePacket(
int port,
ProcessPacketInterface* processor,
QuicPacketCount* packets_dropped) {
- // Allocate some extra space so we can send an error if the packet is larger
- // than kMaxPacketSize.
- char buf[2 * kMaxPacketSize];
+ char buf[kMaxPacketSize];
IPEndPoint client_address;
IPAddressNumber server_ip;
« no previous file with comments | « net/tools/quic/quic_packet_reader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698