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

Side by Side Diff: net/tools/quic/quic_dispatcher.cc

Issue 908623002: Revert of Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 unified diff | Download patch
« no previous file with comments | « net/quic/test_tools/quic_config_peer.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/tools/quic/quic_dispatcher.h" 5 #include "net/tools/quic/quic_dispatcher.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // in OnAuthenticatedHeader. 202 // in OnAuthenticatedHeader.
203 framer_.ProcessPacket(packet); 203 framer_.ProcessPacket(packet);
204 // TODO(rjshade): Return a status describing if/why a packet was dropped, 204 // TODO(rjshade): Return a status describing if/why a packet was dropped,
205 // and log somehow. Maybe expose as a varz. 205 // and log somehow. Maybe expose as a varz.
206 } 206 }
207 207
208 bool QuicDispatcher::OnUnauthenticatedPublicHeader( 208 bool QuicDispatcher::OnUnauthenticatedPublicHeader(
209 const QuicPacketPublicHeader& header) { 209 const QuicPacketPublicHeader& header) {
210 QuicSession* session = nullptr; 210 QuicSession* session = nullptr;
211 211
212 // Port zero is only allowed for unidirectional UDP, so is disallowed by QUIC.
213 // Given that we can't even send a reply rejecting the packet, just black hole
214 // it.
215 if (current_client_address_.port() == 0) {
216 return false;
217 }
218
219 QuicConnectionId connection_id = header.connection_id; 212 QuicConnectionId connection_id = header.connection_id;
220 SessionMap::iterator it = session_map_.find(connection_id); 213 SessionMap::iterator it = session_map_.find(connection_id);
221 if (it == session_map_.end()) { 214 if (it == session_map_.end()) {
222 if (header.reset_flag) { 215 if (header.reset_flag) {
223 return false; 216 return false;
224 } 217 }
225 if (time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)) { 218 if (time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)) {
226 return HandlePacketForTimeWait(header); 219 return HandlePacketForTimeWait(header);
227 } 220 }
228 221
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( 405 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId(
413 header.connection_id)); 406 header.connection_id));
414 407
415 // Continue parsing the packet to extract the sequence number. Then 408 // Continue parsing the packet to extract the sequence number. Then
416 // send it to the time wait manager in OnUnathenticatedHeader. 409 // send it to the time wait manager in OnUnathenticatedHeader.
417 return true; 410 return true;
418 } 411 }
419 412
420 } // namespace tools 413 } // namespace tools
421 } // namespace net 414 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_config_peer.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698