OLD | NEW |
---|---|
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...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // Further, 2 exceptions exist. 1. issue 3927 in which a proxy is forcing TCP |
337 // localhost only, we're allowing Loopback IP even if it's not the same as the | 337 // bound to localhost only, we're allowing Loopback IP even if it's not the |
338 // local Turn port. | 338 // same as the local Turn port. 2. issue 4780 when multiple_routes is |
339 // disabled, the local ip is bound to any address. | |
pthatcher1
2015/06/18 21:25:30
I think we could make this comment more clear. M
guoweis_webrtc
2015/06/19 17:37:49
Done.
| |
339 if (socket->GetLocalAddress().ipaddr() != ip()) { | 340 if (socket->GetLocalAddress().ipaddr() != ip()) { |
340 if (socket->GetLocalAddress().IsLoopbackIP()) { | 341 if (socket->GetLocalAddress().IsLoopbackIP() || |
342 IPIsAny(ip())) { | |
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."; |
pthatcher1
2015/06/18 21:25:31
I think it would be better to have two different l
guoweis_webrtc
2015/06/19 17:37:49
Done.
| |
345 } else { | 347 } else { |
346 LOG(LS_WARNING) << "Socket is bound to a different address:" | 348 LOG(LS_WARNING) << "Socket is bound to a different address:" |
347 << socket->GetLocalAddress().ipaddr().ToString() | 349 << socket->GetLocalAddress().ipaddr().ToString() |
348 << ", rather then the local port:" << ip().ToString() | 350 << ", rather then the local port:" << ip().ToString() |
349 << ". Discarding TURN port."; | 351 << ". Discarding TURN port."; |
350 OnAllocateError(); | 352 OnAllocateError(); |
351 return; | 353 return; |
352 } | 354 } |
353 } | 355 } |
354 | 356 |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1328 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 | 1330 // bind request as per http://tools.ietf.org/html/rfc5766#section-11.3 |
1329 if (code == STUN_ERROR_STALE_NONCE) { | 1331 if (code == STUN_ERROR_STALE_NONCE) { |
1330 if (port_->UpdateNonce(response)) { | 1332 if (port_->UpdateNonce(response)) { |
1331 // Send channel bind request with fresh nonce. | 1333 // Send channel bind request with fresh nonce. |
1332 SendChannelBindRequest(0); | 1334 SendChannelBindRequest(0); |
1333 } | 1335 } |
1334 } | 1336 } |
1335 } | 1337 } |
1336 | 1338 |
1337 } // namespace cricket | 1339 } // namespace cricket |
OLD | NEW |