| OLD | NEW |
| 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 set_flags(flags() | PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION); | 544 set_flags(flags() | PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION); |
| 545 } | 545 } |
| 546 // If the adapter enumeration is disabled, we'll just bind to any address | 546 // If the adapter enumeration is disabled, we'll just bind to any address |
| 547 // instead of specific NIC. This is to ensure the same routing for http | 547 // instead of specific NIC. This is to ensure the same routing for http |
| 548 // traffic by OS is also used here to avoid any local or public IP leakage | 548 // traffic by OS is also used here to avoid any local or public IP leakage |
| 549 // during stun process. | 549 // during stun process. |
| 550 if (flags() & PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION) { | 550 if (flags() & PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION) { |
| 551 network_manager->GetAnyAddressNetworks(&networks); | 551 network_manager->GetAnyAddressNetworks(&networks); |
| 552 } else { | 552 } else { |
| 553 network_manager->GetNetworks(&networks); | 553 network_manager->GetNetworks(&networks); |
| 554 // If network enumeration fails, use the ANY address as a fallback, so we |
| 555 // can at least try gathering candidates using the default route chosen by |
| 556 // the OS. |
| 557 if (networks.empty()) { |
| 558 network_manager->GetAnyAddressNetworks(&networks); |
| 559 } |
| 554 } | 560 } |
| 555 networks.erase(std::remove_if(networks.begin(), networks.end(), | 561 networks.erase(std::remove_if(networks.begin(), networks.end(), |
| 556 [this](rtc::Network* network) { | 562 [this](rtc::Network* network) { |
| 557 return allocator_->network_ignore_mask() & | 563 return allocator_->network_ignore_mask() & |
| 558 network->type(); | 564 network->type(); |
| 559 }), | 565 }), |
| 560 networks.end()); | 566 networks.end()); |
| 561 | 567 |
| 562 if (flags() & PORTALLOCATOR_DISABLE_COSTLY_NETWORKS) { | 568 if (flags() & PORTALLOCATOR_DISABLE_COSTLY_NETWORKS) { |
| 563 uint16_t lowest_cost = rtc::kNetworkCostMax; | 569 uint16_t lowest_cost = rtc::kNetworkCostMax; |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1511 ServerAddresses servers; | 1517 ServerAddresses servers; |
| 1512 for (size_t i = 0; i < relays.size(); ++i) { | 1518 for (size_t i = 0; i < relays.size(); ++i) { |
| 1513 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { | 1519 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { |
| 1514 servers.insert(relays[i].ports.front().address); | 1520 servers.insert(relays[i].ports.front().address); |
| 1515 } | 1521 } |
| 1516 } | 1522 } |
| 1517 return servers; | 1523 return servers; |
| 1518 } | 1524 } |
| 1519 | 1525 |
| 1520 } // namespace cricket | 1526 } // namespace cricket |
| OLD | NEW |