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

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

Issue 885713009: Improving junk packet handling for QUIC by ignoring packets with client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@removing_deprecated_flag_84999682
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_dispatcher.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher.cc
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc
index 1771026c97a765f515c23e9813c185cb2d294149..46f672ea0f100e0a4952362367da51fa4b450e47 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -209,6 +209,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()) {
« no previous file with comments | « net/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698