Chromium Code Reviews

Side by Side Diff: webrtc/p2p/base/turnport.cc

Issue 1196453005: Issue 4780: disabling multiple_routes breaks Turn/Tcp. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2012 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 315 matching lines...)
326 return true; 326 return true;
327 } 327 }
328 328
329 void TurnPort::OnSocketConnect(rtc::AsyncPacketSocket* socket) { 329 void TurnPort::OnSocketConnect(rtc::AsyncPacketSocket* socket) {
330 ASSERT(server_address_.proto == PROTO_TCP); 330 ASSERT(server_address_.proto == PROTO_TCP);
331 // Do not use this port if the socket bound to a different address than 331 // Do not use this port if the socket bound to a different address than
332 // the one we asked for. This is seen in Chrome, where TCP sockets cannot be 332 // the one we asked for. This is seen in Chrome, where TCP sockets cannot be
333 // given a binding address, and the platform is expected to pick the 333 // given a binding address, and the platform is expected to pick the
334 // correct local address. 334 // correct local address.
335 335
336 // Further, to workaround issue 3927 in which a proxy is forcing TCP bound to 336 // However, there are two situations in which we allow the bound address to
337 // localhost only, we're allowing Loopback IP even if it's not the same as the 337 // differ from the requested address: 1. The bound address is the loopback
338 // local Turn port. 338 // address. This happens when a proxy forces TCP to bind to only the
339 // localhost address (see issue 3927). 2. The bound address is the "any
340 // address". This happens when multiple_routes is disabled (see issue 4780).
339 if (socket->GetLocalAddress().ipaddr() != ip()) { 341 if (socket->GetLocalAddress().ipaddr() != ip()) {
340 if (socket->GetLocalAddress().IsLoopbackIP()) { 342 if (socket->GetLocalAddress().IsLoopbackIP()) {
341 LOG(LS_WARNING) << "Socket is bound to a different address:" 343 LOG(LS_WARNING) << "Socket is bound to a different address:"
342 << socket->GetLocalAddress().ipaddr().ToString() 344 << socket->GetLocalAddress().ipaddr().ToString()
343 << ", rather then the local port:" << ip().ToString() 345 << ", rather then the local port:" << ip().ToString()
344 << ". Still allowing it since it's localhost."; 346 << ". Still allowing it since it's localhost.";
347 } else if (IPIsAny(ip())) {
348 LOG(LS_WARNING) << "Socket is bound to a different address:"
349 << socket->GetLocalAddress().ipaddr().ToString()
350 << ", rather then the local port:" << ip().ToString()
351 << ". Still allowing it since it's any address"
352 << ", possibly caused by multiple_routes disabled.";
pthatcher2 2015/06/19 17:40:27 "possibly caused by multiple_routes being disabled
345 } else { 353 } else {
346 LOG(LS_WARNING) << "Socket is bound to a different address:" 354 LOG(LS_WARNING) << "Socket is bound to a different address:"
347 << socket->GetLocalAddress().ipaddr().ToString() 355 << socket->GetLocalAddress().ipaddr().ToString()
348 << ", rather then the local port:" << ip().ToString() 356 << ", rather then the local port:" << ip().ToString()
349 << ". Discarding TURN port."; 357 << ". Discarding TURN port.";
350 OnAllocateError(); 358 OnAllocateError();
351 return; 359 return;
352 } 360 }
353 } 361 }
354 362
(...skipping 973 matching lines...)
1328 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 1336 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3
1329 if (code == STUN_ERROR_STALE_NONCE) { 1337 if (code == STUN_ERROR_STALE_NONCE) {
1330 if (port_->UpdateNonce(response)) { 1338 if (port_->UpdateNonce(response)) {
1331 // Send channel bind request with fresh nonce. 1339 // Send channel bind request with fresh nonce.
1332 SendChannelBindRequest(0); 1340 SendChannelBindRequest(0);
1333 } 1341 }
1334 } 1342 }
1335 } 1343 }
1336 1344
1337 } // namespace cricket 1345 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine