Commit Graph

41 Commits

Author SHA1 Message Date
8dc945cd3b Disable NetworkTest.DefaultLocalAddress for Android.
BUG=4364
R=phoglund@webrtc.org
TBR=mflodman@webrtc.org

Review URL: https://codereview.webrtc.org/2165463006 .

Cr-Commit-Position: refs/heads/master@{#13505}
2016-07-21 08:16:52 +00:00
5622c5eae5 If continual gathering is enabled,
we will periodically check if any network does not have any connection on it and if yes, attempt to re-gather on those networks.

BUG=
R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2025573002 .

Cr-Commit-Position: refs/heads/master@{#13367}
2016-07-01 20:59:39 +00:00
63ab810ce2 Set IOS Wifi interface type based on the interface name.
BUG=webrtc:3149
R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2006893003 .

Cr-Commit-Position: refs/heads/master@{#12939}
2016-05-27 03:30:27 +00:00
351d77b702 Update the type and cost of existing networks
if the network monitor detects it after the native code does.

Also set the network cost for ethernet, wifi, unknown, cellular network type to be 0, 10, 50, 900,
so that unknown networks will have lower precedence than known networks with low cost (like Wifi) but  higher precedence than known networks with high cost.

And third, infer network type based on limited name matching in Android if there is no network monitor or network monitor did not find the type.

BUG=webrtc:5890
R=pthatcher@chromium.org, pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1976683003 .

Cr-Commit-Position: refs/heads/master@{#12833}
2016-05-20 22:08:37 +00:00
555604a746 Replace scoped_ptr with unique_ptr in webrtc/base/
This propagated into various other places. Also had to #include headers that
were implicitly pulled by "scoped_ptr.h".

BUG=webrtc:5520

Review URL: https://codereview.webrtc.org/1920043002

Cr-Commit-Position: refs/heads/master@{#12501}
2016-04-26 10:13:28 +00:00
af83fe65d9 GetDefaultLocalAddress should return the bestIP
on an IPv6 network that contains the actual default local address. This is for preventing potential IP leaking.

BUG=webrtc:5376

Review URL: https://codereview.webrtc.org/1837823005

Cr-Commit-Position: refs/heads/master@{#12417}
2016-04-18 21:50:51 +00:00
a0c44eaa82 Add 16-bit network id to the candidate signaling.
Also include that in the stun-ping request as part of the
network-info attribute.
Change the network cost to be 16 bits.

BUG=

Review URL: https://codereview.webrtc.org/1815473002

Cr-Commit-Position: refs/heads/master@{#12110}
2016-03-23 23:07:54 +00:00
e3c6c82717 When doing continual gathering, remove the local ports when a corresponding network is dropped.
BUG=

Review URL: https://codereview.webrtc.org/1696933003

Cr-Commit-Position: refs/heads/master@{#11660}
2016-02-17 21:00:35 +00:00
a7ad7c3ca0 Get the adapter type information from Android OS.
BUG=

Review URL: https://codereview.webrtc.org/1594673002

Cr-Commit-Position: refs/heads/master@{#11463}
2016-02-02 20:54:28 +00:00
cec0a08275 Add a new interface for creating a udp socket in which it binds the socket to a network if the network handle is set.
Plus, in stunport, turnport and allocation sequence, create a socket using the new interface.

BUG=

Review URL: https://codereview.webrtc.org/1556743002

Cr-Commit-Position: refs/heads/master@{#11279}
2016-01-15 22:49:15 +00:00
56271ed889 fix bug 5430
Fixed misusage of Connection function and also fixed the test case.

BUG=webrtc:5430

Review URL: https://codereview.webrtc.org/1592763003

Cr-Commit-Position: refs/heads/master@{#11278}
2016-01-15 22:45:11 +00:00
0c7e9f540b Removing webrtc::PortAllocatorFactoryInterface.
ICE servers are now passed directly into PortAllocator,
making PortAllocatorFactoryInterface redundant. This CL also
moves SetNetworkIgnoreMask to PortAllocator.

R=phoglund@webrtc.org, pthatcher@webrtc.org, tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/1520963002 .

Cr-Commit-Position: refs/heads/master@{#11139}
2015-12-29 22:15:02 +00:00
9faf154960 Reland 1531763006
Enable IPv6 temporary address filtering on iOS.

We'll only use temporary address for IPv6. However, due to a bug in iOS sdk, the necessary headers are not included. This change copies the minimum necessary definitions such that we could retrieve the ip attributes.

BUG=webrtc:4343

Committed: https://crrev.com/29488c23644721c10a45eba74c67602b0262e582
Cr-Commit-Position: refs/heads/master@{#11114}

patch from issue 1531763006 at patchset 200001 (http://crrev.com/1531763006#ps200001)

TBR=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1551703002 .

Cr-Commit-Position: refs/heads/master@{#11133}
2015-12-28 22:07:05 +00:00
a6c86b23fe Revert "Enable IPv6 temporary address filtering on iOS."
This reverts commit 29488c23644721c10a45eba74c67602b0262e582.

This broke chromium.fyi bot.

TBR=pthatcher@webrtc.org
BUG=

Review URL: https://codereview.webrtc.org/1547883002 .

Cr-Commit-Position: refs/heads/master@{#11115}
2015-12-23 04:17:37 +00:00
29488c2364 Enable IPv6 temporary address filtering on iOS.
We'll only use temporary address for IPv6. However, due to a bug in iOS sdk, the necessary headers are not included. This change copies the minimum necessary definitions such that we could retrieve the ip attributes.

BUG=webrtc:4343

Review URL: https://codereview.webrtc.org/1531763006

Cr-Commit-Position: refs/heads/master@{#11114}
2015-12-23 00:46:48 +00:00
db8cf50c59 Fix two problems in network.cc:
1. It signals network changed events whenever there are more than one IP address in a network.
2. It does not signal network changed events if a network disconnects and connects again.
Also changed DumpNetworks for better debugging.

BUG=webrtc:5096

Review URL: https://codereview.webrtc.org/1421433003

Cr-Commit-Position: refs/heads/master@{#11107}
2015-12-21 21:08:54 +00:00
a34c39e549 GetDefaultLocalAddress should return false when the address is invalid
BUG=
R=pthatcher@webrtc.org

Committed: https://crrev.com/67c6df6153b7b6dceb2b569daf683a498b2fc13c
Cr-Commit-Position: refs/heads/master@{#10779}

Review URL: https://codereview.webrtc.org/1471203002 .

Cr-Commit-Position: refs/heads/master@{#10794}
2015-11-25 21:12:34 +00:00
953eabc027 Revert "GetDefaultLocalAddress should return false when the address is invalid"
This reverts commit 67c6df6153b7b6dceb2b569daf683a498b2fc13c.

TBR=pthatcher@webrtc.org
BUG=

Review URL: https://codereview.webrtc.org/1470363002 .

Cr-Commit-Position: refs/heads/master@{#10780}
2015-11-24 20:00:38 +00:00
67c6df6153 GetDefaultLocalAddress should return false when the address is invalid
BUG=
R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1471203002 .

Cr-Commit-Position: refs/heads/master@{#10779}
2015-11-24 19:59:26 +00:00
9af97f8910 WebRTC should generate default private address even when adapter enumeration is disabled.
Introduce a DefaultAddressProvider such that rtc::Network can't access other part of NetworkManager.

This also removes the hack of generating the loopback address. The dependency has been removed by https://codereview.chromium.org/1417023003/

BUG=webrtc:5061
R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1411253008 .

Cr-Commit-Position: refs/heads/master@{#10590}
2015-11-10 22:47:49 +00:00
023f3ef029 Create network change notifier and pass the event to NetworkManager
BUG=

Review URL: https://codereview.webrtc.org/1391703003

Cr-Commit-Position: refs/heads/master@{#10325}
2015-10-19 16:39:38 +00:00
ea1012b2a4 address comments from https://codereview.webrtc.org/1277263002/
TBR=juberti@webrtc.org,pthather@webrtc.org

Review URL: https://codereview.webrtc.org/1305113002

Cr-Commit-Position: refs/heads/master@{#9757}
2015-08-21 16:06:37 +00:00
47872ec90c In the past, P2PPortAllocator.enable_multiple_routes is the indicator whether we should bind to the any address. It's easy to translate that into a port allocator flag in P2PPortAllocator's ctor. Going forward, we have to depend on an asynchronous permission check to determine whether gathering local address is allowed or not, hence the current way of passing it through constructor approach won't work any more. The asynchronous check will trigger SignalNetowrksChanged so we could only check that inside DoAllocate.
Adapter enumeration disable should be a concept from Network. Network will be hooked up with media permission (mic/camera) to check whether gathering local address is allowed.

BUG=crbug.com/520101
R=juberti@webrtc.org, pthatcher@webrtc.org

Committed: ba9ab4cd8d

Review URL: https://codereview.webrtc.org/1284113003 .

Cr-Commit-Position: refs/heads/master@{#9735}
2015-08-19 17:32:51 +00:00
5d69648782 Disabling TestUdpIPv6 on Linux
BUG=webrtc:4923, 522036
NOTRY=true

Review URL: https://codereview.webrtc.org/1298363002

Cr-Commit-Position: refs/heads/master@{#9734}
2015-08-19 11:42:07 +00:00
370c8848ad Revert "Generate localhost candidate when no STUN/TURN and portallocator has the right flag spefied."
This reverts commit 0a2955f227666efd87b2a303a69c083ef801c528.

Revert "In the past, P2PPortAllocator.enable_multiple_routes is the indicator whether we should bind to the any address. It's easy to translate that into a port allocator flag in P2PPortAllocator's ctor. Going forward, we have to depend on an asynchronous permission check to determine whether gathering local address is allowed or not, hence the current way of passing it through constructor approach won't work any more. The asynchronous check will trigger SignalNetowrksChanged so we could only check that inside DoAllocate."

This reverts commit ba9ab4cd8d2e8fbc068dc36b5e6f6331d7deeccf.

TBR=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1288843003 .

Cr-Commit-Position: refs/heads/master@{#9729}
2015-08-19 00:00:21 +00:00
ba9ab4cd8d In the past, P2PPortAllocator.enable_multiple_routes is the indicator whether we should bind to the any address. It's easy to translate that into a port allocator flag in P2PPortAllocator's ctor. Going forward, we have to depend on an asynchronous permission check to determine whether gathering local address is allowed or not, hence the current way of passing it through constructor approach won't work any more. The asynchronous check will trigger SignalNetowrksChanged so we could only check that inside DoAllocate.
Adapter enumeration disable should be a concept from Network. Network will be hooked up with media permission (mic/camera) to check whether gathering local address is allowed.

BUG=crbug.com/520101
R=juberti@webrtc.org, pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1284113003 .

Cr-Commit-Position: refs/heads/master@{#9728}
2015-08-18 22:54:20 +00:00
bbce5efaa6 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

Committed: https://code.google.com/p/webrtc/source/detail?r=8607

Review URL: https://webrtc-codereview.appspot.com/43529004

Cr-Commit-Position: refs/heads/master@{#8609}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8609 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-05 04:39:07 +00:00
d43b2c098d Revert "Turn on IPv6 for WebRTC as default as required before ramping the experiment to 30%."
This reverts commit 86c33e3a94f51f8e4b4f305708ec327786ad3794.

TBR=guoweis@webrtc.org

BUG=

Review URL: https://webrtc-codereview.appspot.com/47409004

Cr-Commit-Position: refs/heads/master@{#8608}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8608 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-05 04:03:44 +00:00
86c33e3a94 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
2015-03-05 03:40:48 +00:00
07dcf60ee0 Revert 8532 "Ensure only temporary IPv6 address is selected as t..."
> Ensure only temporary IPv6 address is selected as the best IP.
> 
> The current logic of IPv6 selection could still have a small chance for non-temporary address to be selected for candidate. The scenario is that when there is no non-deprecated temporary IP, the global ones could be selected.
> 
> Global ones don't necessarily carry MAC. However, instead of comparing whether it has the MAC in it (sometimes 5 out of 6 elements from a MAC are the same, only one diffs), we should just err on the safe side.
> 
> BUG=4348
> R=juberti@webrtc.org, pthatcher@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/38289004

TBR=guoweis@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/38319004

Cr-Commit-Position: refs/heads/master@{#8534}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8534 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-27 18:42:46 +00:00
385a7ceb1f Ensure only temporary IPv6 address is selected as the best IP.
The current logic of IPv6 selection could still have a small chance for non-temporary address to be selected for candidate. The scenario is that when there is no non-deprecated temporary IP, the global ones could be selected.

Global ones don't necessarily carry MAC. However, instead of comparing whether it has the MAC in it (sometimes 5 out of 6 elements from a MAC are the same, only one diffs), we should just err on the safe side.

BUG=4348
R=juberti@webrtc.org, pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/38289004

Cr-Commit-Position: refs/heads/master@{#8532}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8532 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-27 18:10:43 +00:00
006521d5bd Makes libjingle_peerconnection_android_unittest run on networkless devices.
PeerConnectionTest.java currently works, but only on a device with
network interfaces up. This is not a problem for desktop, but it is a
problem when running on Android devices since the devices in the lab
generally don't have network (due to the chaotic radio environment in
the device labs, devices are simply kept in flight mode).

The test does work if one modifies this line in the file
webrtc/base/network.cc:

bool ignored = ((cursor->ifa_flags & IFF_LOOPBACK) ||
                IsIgnoredNetwork(*network));

If we remove the IFF_LOOPBACK clause, the test starts working on
an Android device in flight mode. This is nice - we're running the
call and packets interact with the OS network stack, which is good
for this end-to-end test. We can't just remove the clause though since
having loopback is undesirable for everyone except the test (right)?
so we need to make this behavior configurable.

This CL takes a stab at a complete solution where we pass a boolean
all the way through the Java PeerConnectionFactory down to the
BasicNetworkManager. This comes as a heavy price in interface
changes though. It's pretty out of proportion, but fundamentally we
need some way of telling the network manager that it is on Android
and in test mode. Passing the boolean all the way through is one way.

Another way might be to put the loopback filter behind an ifdef and
link a custom libjingle_peerconnection.so with the test. That is hacky
but doesn't pollute the interfaces. Not sure how to solve that in GYP
but it could mean some duplication between the production and
test .so files.

It would have been perfect to use flags here, but then we need to
hook up gflags parsing to some main() somewhere to make sure the
flag gets parsed, and make sure to pass that flag in our tests.
I'm not sure how that can be done.

Making the loopback filtering conditional is exactly how we solved the
equivalent problem in content_browsertests in Chrome, and it worked
great.

That's all I could think of.

BUG=4181
R=perkj@webrtc.org, pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36769004

Cr-Commit-Position: refs/heads/master@{#8344}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8344 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-12 09:24:25 +00:00
2444d9605a Control the max IPv6 Networks used by WebRTC.
BUG=
R=juberti@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/38589004

Cr-Commit-Position: refs/heads/master@{#8209}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8209 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-30 00:09:42 +00:00
a094cac11f Add stats for network merge.
Currently, in ipc_network_manager.cc, the UMA WebRTC.PeerConnection.IPv4Interfaces and its IPv6
counter part counts the addresses, instead of the interfaces as when
chromium delivers available networks to WebRTC, each address is wrapped
inside an individual network object.

The plan is to replace the current MergeNetworkList with the new one once it's rolled into chromium.

BUG=
R=pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36779004

Cr-Commit-Position: refs/heads/master@{#8188}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8188 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-28 19:34:17 +00:00
369a637ac8 Implemented Network::GetBestIP() selection logic as following.
1) return the first global temporary and non-deprecrated ones.
2) if #1 not available, return global one.
3) if #2 not available, use ULA ipv6 as last resort.

ULA stands for unique local address. They are only useful in a private
WebRTC deployment. More detail: http://en.wikipedia.org/wiki/Unique_local_address

BUG=3808

At this point, 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.

R=jiayl@webrtc.org

Committed: https://code.google.com/p/webrtc/source/detail?r=7200

Committed: https://code.google.com/p/webrtc/source/detail?r=7201

Review URL: https://webrtc-codereview.appspot.com/31369004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7216 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-09-17 22:37:29 +00:00
40c2aa36f2 Implemented Network::GetBestIP() selection logic as following.
1) return the first global temporary and non-deprecrated ones.
2) if #1 not available, return global one.
3) if #2 not available, use ULA ipv6 as last resort.

ULA stands for unique local address. They are only useful in a private
WebRTC deployment. More detail: http://en.wikipedia.org/wiki/Unique_local_address

BUG=3808

At this point, 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.

R=jiayl@webrtc.org

Committed: https://code.google.com/p/webrtc/source/detail?r=7200

Review URL: https://webrtc-codereview.appspot.com/31369004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7201 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-09-16 20:29:41 +00:00
f8bff762d1 Implemented Network::GetBestIP() selection logic as following.
1) return the first global temporary and non-deprecrated ones.
2) if #1 not available, return global one.
3) if #2 not available, use ULA ipv6 as last resort.

ULA stands for unique local address. They are only useful in a private
WebRTC deployment. More detail: http://en.wikipedia.org/wiki/Unique_local_address

BUG=3808

At this point, 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.

R=jiayl@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/31369004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7200 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-09-16 20:17:22 +00:00
4bbd3c83a8 fix a bug in the logic when new Networks are merged. This happens when
we have 2 networks with the same key

BUG=410554 in chromium

http://code.google.com/p/chromium/issues/detail?id=410554

Corresponding change in chromium is
https://codereview.chromium.org/536133003/

R=jiayl@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/19249005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7117 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-09-09 13:54:45 +00:00
f048872e91 Adds a modified copy of talk/base to webrtc/base. It is the first step in
migrating talk/base to webrtc/base.

BUG=N/A
R=niklas.enbom@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/17479005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6129 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-13 18:00:26 +00:00
e9a604accd Revert 6107 "Adds a modified copy of talk/base to webrtc/base. I..."
This breaks Chromium FYI builds and prevent roll of webrtc/libjingle to Chrome.

http://chromegw.corp.google.com/i/chromium.webrtc.fyi/builders/Win%20Builder/builds/457


> Adds a modified copy of talk/base to webrtc/base. It is the first step in migrating talk/base to webrtc/base.
> 
> BUG=N/A
> R=andrew@webrtc.org, wu@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/12199004

TBR=henrike@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/14479004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6116 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-13 08:15:48 +00:00
2c7d1b39b9 Adds a modified copy of talk/base to webrtc/base. It is the first step in migrating talk/base to webrtc/base.
BUG=N/A
R=andrew@webrtc.org, wu@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/12199004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6107 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-12 18:03:09 +00:00