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

Side by Side Diff: webrtc/p2p/client/basicportallocator.cc

Issue 1378753003: WebRTC might leak srflx ip address when multiple_routes disabled and IceTransportType is relay (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 ASSERT(rtc::Thread::Current() == network_thread_); 466 ASSERT(rtc::Thread::Current() == network_thread_);
467 PortData* data = FindPort(port); 467 PortData* data = FindPort(port);
468 ASSERT(data != NULL); 468 ASSERT(data != NULL);
469 // Discarding any candidate signal if port allocation status is 469 // Discarding any candidate signal if port allocation status is
470 // already in completed state. 470 // already in completed state.
471 if (data->complete()) 471 if (data->complete())
472 return; 472 return;
473 473
474 ProtocolType pvalue; 474 ProtocolType pvalue;
475 bool candidate_signalable = CheckCandidateFilter(c); 475 bool candidate_signalable = CheckCandidateFilter(c);
476
477 // Here we only allow the port if the CF_HOST was originally specified in the
478 // allocator's candidate filter, as when enumeration is disabled, the port's
479 // filter has been modified to prevent local address leakage. If this local
480 // port is not filtered out, it'll send STUN ping and cause IP address leak.
pthatcher1 2015/09/30 05:32:10 I think this could be a little more, perhaps with
guoweis_webrtc 2015/09/30 16:29:28 Done.
476 bool candidate_pairable = 481 bool candidate_pairable =
477 candidate_signalable || 482 candidate_signalable ||
478 (c.address().IsAnyIP() && 483 ((allocator_->candidate_filter() & CF_HOST) && c.address().IsAnyIP() &&
479 (port->SharedSocket() || c.protocol() == TCP_PROTOCOL_NAME)); 484 (port->SharedSocket() || c.protocol() == TCP_PROTOCOL_NAME));
pthatcher1 2015/09/30 05:32:10 This is getting a little hard to read. Perhaps so
guoweis_webrtc 2015/09/30 16:29:28 Done.
480 bool candidate_protocol_enabled = 485 bool candidate_protocol_enabled =
481 StringToProto(c.protocol().c_str(), &pvalue) && 486 StringToProto(c.protocol().c_str(), &pvalue) &&
482 data->sequence()->ProtocolEnabled(pvalue); 487 data->sequence()->ProtocolEnabled(pvalue);
483 488
484 if (candidate_signalable && candidate_protocol_enabled) { 489 if (candidate_signalable && candidate_protocol_enabled) {
485 std::vector<Candidate> candidates; 490 std::vector<Candidate> candidates;
486 candidates.push_back(c); 491 candidates.push_back(c);
487 SignalCandidatesReady(this, candidates); 492 SignalCandidatesReady(this, candidates);
488 } 493 }
489 494
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 ServerAddresses servers; 1180 ServerAddresses servers;
1176 for (size_t i = 0; i < relays.size(); ++i) { 1181 for (size_t i = 0; i < relays.size(); ++i) {
1177 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { 1182 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) {
1178 servers.insert(relays[i].ports.front().address); 1183 servers.insert(relays[i].ports.front().address);
1179 } 1184 }
1180 } 1185 }
1181 return servers; 1186 return servers;
1182 } 1187 }
1183 1188
1184 } // namespace cricket 1189 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | webrtc/p2p/client/portallocator_unittest.cc » ('j') | webrtc/p2p/client/portallocator_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698