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

Unified Diff: net/quic/quic_dispatcher.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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/quic/quic_data_writer_test.cc ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_dispatcher.cc
diff --git a/net/quic/quic_dispatcher.cc b/net/quic/quic_dispatcher.cc
index ee2c0c6df2b1b0bb0dab2890e6260db87c1b59f0..f750bfaef39f64b009818389cea2961695e3a4c0 100644
--- a/net/quic/quic_dispatcher.cc
+++ b/net/quic/quic_dispatcher.cc
@@ -204,6 +204,13 @@ bool QuicDispatcher::OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header) {
QuicSession* session = nullptr;
+ // Port zero is only allowed for unidirectional UDP, so is disallowed by QUIC.
+ // Given that we can't even send a reply rejecting the packet, just black hole
+ // it.
+ if (current_client_address_.port() == 0) {
+ return false;
+ }
+
QuicConnectionId connection_id = header.connection_id;
SessionMap::iterator it = session_map_.find(connection_id);
if (it == session_map_.end()) {
@@ -242,7 +249,7 @@ bool QuicDispatcher::OnUnauthenticatedPublicHeader(
return HandlePacketForTimeWait(header);
}
DVLOG(1) << "Created new session for " << connection_id;
- session_map_.insert(make_pair(connection_id, session));
+ session_map_.insert(std::make_pair(connection_id, session));
} else {
session = it->second;
}
@@ -337,7 +344,7 @@ void QuicDispatcher::OnWriteBlocked(
// infinite loops in OnCanWrite.
return;
}
- write_blocked_list_.insert(make_pair(blocked_writer, true));
+ write_blocked_list_.insert(std::make_pair(blocked_writer, true));
}
void QuicDispatcher::OnConnectionAddedToTimeWaitList(
« no previous file with comments | « net/quic/quic_data_writer_test.cc ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698