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

Unified Diff: webrtc/rtc_base/network.cc

Issue 2983213002: Relanding: Move "max IPv6 networks" logic to BasicPortAllocator, and fix sorting. (Closed)
Patch Set: Fixing P2PTransportChannelMultihomedTest (was relying on ordering assumptions it shouldn't have beeā€¦ Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/rtc_base/network.h ('k') | webrtc/rtc_base/network_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/rtc_base/network.cc
diff --git a/webrtc/rtc_base/network.cc b/webrtc/rtc_base/network.cc
index 1f4a705db030e5b689e46b5fc460e7571e24e609..26d6520e22b20712ef3f0cfe76b5053a84296f04 100644
--- a/webrtc/rtc_base/network.cc
+++ b/webrtc/rtc_base/network.cc
@@ -45,11 +45,6 @@
namespace rtc {
namespace {
-// Turning on IPv6 could make many IPv6 interfaces available for connectivity
-// check and delay the call setup time. kMaxIPv6Networks is the default upper
-// limit of IPv6 networks but could be changed by set_max_ipv6_networks().
-const int kMaxIPv6Networks = 5;
-
const uint32_t kUpdateNetworksMessage = 1;
const uint32_t kSignalNetworksMessage = 2;
@@ -93,7 +88,7 @@ bool SortNetworks(const Network* a, const Network* b) {
// TODO(mallinath) - Add VPN and Link speed conditions while sorting.
// Networks are sorted last by key.
- return a->key() > b->key();
+ return a->key() < b->key();
}
std::string AdapterTypeToString(AdapterType type) {
@@ -175,7 +170,6 @@ bool NetworkManager::GetDefaultLocalAddress(int family, IPAddress* addr) const {
NetworkManagerBase::NetworkManagerBase()
: enumeration_permission_(NetworkManager::ENUMERATION_ALLOWED),
- max_ipv6_networks_(kMaxIPv6Networks),
ipv6_enabled_(true) {
}
@@ -213,18 +207,8 @@ void NetworkManagerBase::GetAnyAddressNetworks(NetworkList* networks) {
}
void NetworkManagerBase::GetNetworks(NetworkList* result) const {
- int ipv6_networks = 0;
result->clear();
- for (Network* network : networks_) {
- // Keep the number of IPv6 networks under |max_ipv6_networks_|.
- if (network->prefix().family() == AF_INET6) {
- if (ipv6_networks >= max_ipv6_networks_) {
- continue;
- }
- ++ipv6_networks;
- }
- result->push_back(network);
- }
+ result->insert(result->begin(), networks_.begin(), networks_.end());
}
void NetworkManagerBase::MergeNetworkList(const NetworkList& new_networks,
« no previous file with comments | « webrtc/rtc_base/network.h ('k') | webrtc/rtc_base/network_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698