| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |