summaryrefslogtreecommitdiff
path: root/base/network.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/network.h')
-rw-r--r--base/network.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/base/network.h b/base/network.h
index 4cdd4d8e..6f9d08e7 100644
--- a/base/network.h
+++ b/base/network.h
@@ -188,19 +188,28 @@ class Network {
std::string key() const { return key_; }
// Returns the Network's current idea of the 'best' IP it has.
- // 'Best' currently means the first one added.
- // Returns an unset IP if this network has no active addresses.
- // Here is the rule on how we mark the IPv6 address as ignorable for webrtc.
+ // Or return an unset IP if this network has no active addresses.
+ // Here is the rule on how we mark the IPv6 address as ignorable for WebRTC.
// 1) return all global temporary dynamic and non-deprecrated ones.
- // 2) if #1 not available, return global dynamic ones.
- // 3) if #2 not available, return global ones.
- // 4) if #3 not available, use ULA ipv6 as last resort.
+ // 2) if #1 not available, return global ones.
+ // 3) if #2 not available, use ULA ipv6 as last resort. (ULA stands
+ // for unique local address, which is not route-able in open
+ // internet but might be useful for a close WebRTC deployment.
+
+ // TODO(guoweis): rule #3 actually won't happen at current
+ // implementation. The reason being that ULA address starting with
+ // 0xfc 0r 0xfd will be grouped into its own Network. The result of
+ // that is WebRTC will have one extra Network to generate candidates
+ // but the lack of rule #3 shouldn't prevent turning on IPv6 since
+ // ULA should only be tried in a close deployment anyway.
+
// Note that when not specifying any flag, it's treated as case global
- // dynamic IPv6 address
- // TODO(guoweis): will change the name to a more meaningful name as
- // this is not simply return the first address once the logic of ipv6
- // address selection is complete.
- IPAddress ip() const;
+ // IPv6 address
+ IPAddress GetBestIP() const;
+
+ // Keep the original function here for now.
+ // TODO(guoweis): Remove this when all callers are migrated to GetBestIP().
+ IPAddress ip() const { return GetBestIP(); }
// Adds an active IP address to this network. Does not check for duplicates.
void AddIP(const InterfaceAddress& ip) { ips_.push_back(ip); }