Turn on IPv6 for WebRTC as default as required before ramping the experiment to 30%.
BUG= R=juberti@webrtc.org Committed: https://code.google.com/p/webrtc/source/detail?r=8582 Review URL: https://webrtc-codereview.appspot.com/43529004 Cr-Commit-Position: refs/heads/master@{#8607} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8607 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -341,17 +341,18 @@ bool PeerConnection::Initialize(
|
|||||||
int portallocator_flags = port_allocator_->flags();
|
int portallocator_flags = port_allocator_->flags();
|
||||||
portallocator_flags |= cricket::PORTALLOCATOR_ENABLE_BUNDLE |
|
portallocator_flags |= cricket::PORTALLOCATOR_ENABLE_BUNDLE |
|
||||||
cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
|
cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
|
||||||
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET;
|
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET |
|
||||||
|
cricket::PORTALLOCATOR_ENABLE_IPV6;
|
||||||
bool value;
|
bool value;
|
||||||
// If IPv6 flag was specified, we'll not override it by experiment.
|
// If IPv6 flag was specified, we'll not override it by experiment.
|
||||||
if (FindConstraint(
|
if (FindConstraint(
|
||||||
constraints, MediaConstraintsInterface::kEnableIPv6, &value, NULL)) {
|
constraints, MediaConstraintsInterface::kEnableIPv6, &value, NULL)) {
|
||||||
if (value) {
|
if (!value) {
|
||||||
portallocator_flags |= cricket::PORTALLOCATOR_ENABLE_IPV6;
|
portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6);
|
||||||
}
|
}
|
||||||
} else if (webrtc::field_trial::FindFullName("WebRTC-IPv6Default") ==
|
} else if (webrtc::field_trial::FindFullName("WebRTC-IPv6Default") ==
|
||||||
"Enabled") {
|
"Disabled") {
|
||||||
portallocator_flags |= cricket::PORTALLOCATOR_ENABLE_IPV6;
|
portallocator_flags &= ~(cricket::PORTALLOCATOR_ENABLE_IPV6);
|
||||||
}
|
}
|
||||||
|
|
||||||
port_allocator_->set_flags(portallocator_flags);
|
port_allocator_->set_flags(portallocator_flags);
|
||||||
|
|||||||
@@ -432,6 +432,12 @@ bool IPIs6To4(const IPAddress& ip) {
|
|||||||
return IPIsHelper(ip, k6To4Prefix, 16);
|
return IPIsHelper(ip, k6To4Prefix, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IPIsLinkLocal(const IPAddress& ip) {
|
||||||
|
// Can't use the helper because the prefix is 10 bits.
|
||||||
|
in6_addr addr = ip.ipv6_address();
|
||||||
|
return addr.s6_addr[0] == 0xFE && (addr.s6_addr[1] & 0x80) == 0x80;
|
||||||
|
}
|
||||||
|
|
||||||
bool IPIsSiteLocal(const IPAddress& ip) {
|
bool IPIsSiteLocal(const IPAddress& ip) {
|
||||||
// Can't use the helper because the prefix is 10 bits.
|
// Can't use the helper because the prefix is 10 bits.
|
||||||
in6_addr addr = ip.ipv6_address();
|
in6_addr addr = ip.ipv6_address();
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ size_t HashIP(const IPAddress& ip);
|
|||||||
// These are only really applicable for IPv6 addresses.
|
// These are only really applicable for IPv6 addresses.
|
||||||
bool IPIs6Bone(const IPAddress& ip);
|
bool IPIs6Bone(const IPAddress& ip);
|
||||||
bool IPIs6To4(const IPAddress& ip);
|
bool IPIs6To4(const IPAddress& ip);
|
||||||
|
bool IPIsLinkLocal(const IPAddress& ip);
|
||||||
bool IPIsSiteLocal(const IPAddress& ip);
|
bool IPIsSiteLocal(const IPAddress& ip);
|
||||||
bool IPIsTeredo(const IPAddress& ip);
|
bool IPIsTeredo(const IPAddress& ip);
|
||||||
bool IPIsULA(const IPAddress& ip);
|
bool IPIsULA(const IPAddress& ip);
|
||||||
|
|||||||
@@ -601,6 +601,13 @@ bool BasicNetworkManager::IsIgnoredNetwork(const Network& network) const {
|
|||||||
if (network.prefix().family() == AF_INET) {
|
if (network.prefix().family() == AF_INET) {
|
||||||
return (network.prefix().v4AddressAsHostOrderInteger() < 0x01000000);
|
return (network.prefix().v4AddressAsHostOrderInteger() < 0x01000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Linklocal addresses require scope id to be bound successfully. However, our
|
||||||
|
// IPAddress structure doesn't carry that so the information is lost and
|
||||||
|
// causes binding failure.
|
||||||
|
if (IPIsLinkLocal(network.GetBestIP())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -285,13 +285,13 @@ TEST_F(NetworkTest, TestBasicMergeNetworkList) {
|
|||||||
void SetupNetworks(NetworkManager::NetworkList* list) {
|
void SetupNetworks(NetworkManager::NetworkList* list) {
|
||||||
IPAddress ip;
|
IPAddress ip;
|
||||||
IPAddress prefix;
|
IPAddress prefix;
|
||||||
EXPECT_TRUE(IPFromString("fe80::1234:5678:abcd:ef12", &ip));
|
EXPECT_TRUE(IPFromString("abcd::1234:5678:abcd:ef12", &ip));
|
||||||
EXPECT_TRUE(IPFromString("fe80::", &prefix));
|
EXPECT_TRUE(IPFromString("abcd::", &prefix));
|
||||||
// First, fake link-locals.
|
// First, fake link-locals.
|
||||||
Network ipv6_eth0_linklocalnetwork("test_eth0", "Test NetworkAdapter 1",
|
Network ipv6_eth0_linklocalnetwork("test_eth0", "Test NetworkAdapter 1",
|
||||||
prefix, 64);
|
prefix, 64);
|
||||||
ipv6_eth0_linklocalnetwork.AddIP(ip);
|
ipv6_eth0_linklocalnetwork.AddIP(ip);
|
||||||
EXPECT_TRUE(IPFromString("fe80::5678:abcd:ef12:3456", &ip));
|
EXPECT_TRUE(IPFromString("abcd::5678:abcd:ef12:3456", &ip));
|
||||||
Network ipv6_eth1_linklocalnetwork("test_eth1", "Test NetworkAdapter 2",
|
Network ipv6_eth1_linklocalnetwork("test_eth1", "Test NetworkAdapter 2",
|
||||||
prefix, 64);
|
prefix, 64);
|
||||||
ipv6_eth1_linklocalnetwork.AddIP(ip);
|
ipv6_eth1_linklocalnetwork.AddIP(ip);
|
||||||
|
|||||||
Reference in New Issue
Block a user