Commit Graph

257 Commits

Author SHA1 Message Date
Michal Novotny
a85ff06ef1 Bug 1593693 - nsINetworkLinkService.isLinkUp returns true when no network connection is available, r=valentin
Determining link status from states and addresses of the individual interfaces isn't always reliable. With this patch we assume the link is up when we could find a route for kRouteCheckIPv4 host or kRouteCheckIPv6 host.

Differential Revision: https://phabricator.services.mozilla.com/D52027

--HG--
extra : moz-landing-system : lando
2019-11-07 11:45:13 +00:00
Michal Novotny
787ca4f17b Bug 1593658 - network ID: Fix detecting mobile data link on some Android versions, r=valentin
When we fail to detect the link as mobile data device, we use GW address for ID calculation. And because GW changes often in case of mobile data we often get different ID for the same network.

Differential Revision: https://phabricator.services.mozilla.com/D51612

--HG--
extra : moz-landing-system : lando
2019-11-04 19:45:49 +00:00
Kershaw Chang
07ce7a231c Bug 1589448 - Add network id changed event on MacOS r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D50463

--HG--
extra : moz-landing-system : lando
2019-10-29 23:19:03 +00:00
Kershaw Chang
8afce6a668 Bug 1588217 - Use SystemConfiguration framework to get DNS search domains r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D49476

--HG--
extra : moz-landing-system : lando
2019-10-29 23:05:17 +00:00
Gurzau Raul
75def3b448 Backed out changeset 0961f4328316 (bug 1588056) for build bustage at nsNetworkLinkService.mm on a CLOSED TREE. 2019-10-30 00:57:27 +02:00
Dragana Damjanovic
3071f2992e Bug 1588056 - Add telemetry about the time between network change events if we do the events coalescing. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D48954

--HG--
extra : moz-landing-system : lando
2019-10-29 22:25:40 +00:00
Narcis Beleuzu
9e239f2b4a Backed out 2 changesets (bug 1589461, bug 1589447) for wpt failures on report-only-in-meta.sub.html
Backed out changeset e58350a47d50 (bug 1589461)
Backed out changeset abdcdc97cd4c (bug 1589447)
2019-10-29 19:05:09 +02:00
Michal Novotny
0eadedd8b8 Bug 1589461 - Add network id change event (Android), r=kershaw
Differential Revision: https://phabricator.services.mozilla.com/D50429

--HG--
extra : moz-landing-system : lando
2019-10-29 09:04:13 +00:00
Michal Novotny
9f3a7ca5a2 Bug 1589447 - Add network id change event (linux), r=kershaw
This patch splits network change event into 2 events:
1) network ID change event
It is sent when the calculated ID differs from the previous one.

2) network change event
It is sent when the network ID has changed or when any address has been added, removed or changed.

Differential Revision: https://phabricator.services.mozilla.com/D50391

--HG--
extra : moz-landing-system : lando
2019-10-29 09:37:58 +00:00
Michal Novotny
02ec9a0a47 Bug 1590250 - network ID: different ID is detected after re-enabling mobile data, r=valentin
For same reason, there are artificial MAC addresses available on some non-ethernet link devices. With this patch we ignore all neighbor messages for non-ethernet links. Also, when traffic for the checked host is routed via rmnet_data device, we skip hashing IP of next hop, because it changes very often in case of some mobile providers.

Differential Revision: https://phabricator.services.mozilla.com/D50184

--HG--
extra : moz-landing-system : lando
2019-10-23 13:17:46 +00:00
Valentin Gosu
fe3c993ae7 Bug 1588219 - Expose DNS suffix list (Linux) r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D49414

--HG--
extra : moz-landing-system : lando
2019-10-22 19:46:28 +00:00
Kershaw Chang
5a6e10c586 Bug 1584165 - Calaulate network id with delay after network changed r=michal
Differential Revision: https://phabricator.services.mozilla.com/D48446

--HG--
extra : moz-landing-system : lando
2019-10-17 14:24:57 +00:00
Razvan Maries
af59d8f13e Backed out changeset 61a42130beb8 (bug 1588056) for build bustages on nsNetworkLinkService.mm. CLOSED TREE 2019-10-16 00:34:01 +03:00
Dragana Damjanovic
58d9498a00 Bug 1588056 - Add telemetry about the time between network change events if we do the events coalescing. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D48954

--HG--
extra : moz-landing-system : lando
2019-10-11 16:13:35 +00:00
Valentin Gosu
65efbcd070 Bug 1558840 - Add nsINetworkLinkService.dnsSuffixList implementation for windows r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D48556

--HG--
extra : moz-landing-system : lando
2019-10-10 16:21:19 +00:00
Michal Novotny
d206228f78 Bug 1586731 - network ID: drop routes/addresses when link/address is removed by the kernel, r=valentin
Kernel can drop routes, addresses and neighbors without notification via netlink. So we update information in our structures as follows:
- when a link is removed all associated routes, addresses and neighbors are removed too
- when a link is disabled all associated routes and neighbors are removed
- when an address on a link is removed all routes and neighbors from this network are removed

All routes, neighbors and addresses always belong to some link, so a new class LinkInfo was created and it holds all information related to a single link. This makes finding information related to a specific link much easier.

Differential Revision: https://phabricator.services.mozilla.com/D48360

--HG--
extra : moz-landing-system : lando
2019-10-08 13:05:42 +00:00
Razvan Maries
c748295700 Backed out changeset fbc6bf62b19d (bug 1586731) for perma fails on nsAutoPtr.h. CLOSED TREE 2019-10-08 15:44:06 +03:00
Michal Novotny
e16c1f2400 Bug 1586731 - network ID: drop routes/addresses when link/address is removed by the kernel, r=valentin
Kernel can drop routes, addresses and neighbors without notification via netlink. So we update information in our structures as follows:
- when a link is removed all associated routes, addresses and neighbors are removed too
- when a link is disabled all associated routes and neighbors are removed
- when an address on a link is removed all routes and neighbors from this network are removed

All routes, neighbors and addresses always belong to some link, so a new class LinkInfo was created and it holds all information related to a single link. This makes finding information related to a specific link much easier.

Differential Revision: https://phabricator.services.mozilla.com/D48360

--HG--
extra : moz-landing-system : lando
2019-10-08 12:08:15 +00:00
Michal Novotny
3b3f253dd6 Bug 1585920 - network ID: fix VPN detection on Linux for non ethernet devices, r=valentin
In case of non ethernet device we can never get a MAC address of the next hop, so skip MAC lookup and proceed directly to network ID calculation based on device name and IP/network address.

Differential Revision: https://phabricator.services.mozilla.com/D48049

--HG--
extra : moz-landing-system : lando
2019-10-07 14:34:38 +00:00
Michal Novotny
7cb94b9058 Bug 1584089 - Use only global routes for network ID calculation, r=valentin
Although local link addresses are not routable, some Android versions have default route for such prefix. We need to ignore any non-global routes when calculating ID.

Differential Revision: https://phabricator.services.mozilla.com/D47578

--HG--
extra : moz-landing-system : lando
2019-10-01 12:58:18 +00:00
Valentin Gosu
561f9c7ff6 Bug 1583170 - Dispatch nsNotifyAddrListener runnable after creating thread r=michal
Bug 1576386 converted the thread into a threadpool, but when changing that it failed to dispatch the runnable to the thread/threadpool as before.
As a result nsNotifyAddrListener stopped listening for network change events on windows.

Differential Revision: https://phabricator.services.mozilla.com/D46932

--HG--
extra : moz-landing-system : lando
2019-09-25 12:59:26 +00:00
Michal Novotny
e994509c2a Bug 1583204 - No Network ID is available when switching between WiFi and Lan networks, r=valentin
There can be multiple records for the same neighbor with different interface index when the computer is connected to the same network via multiple interfaces, e.g. LAN and WiFi. This patch adds interface index to the key, so when some interface goes down it doesn't remove records belonging to a different interface.

Differential Revision: https://phabricator.services.mozilla.com/D47017

--HG--
extra : moz-landing-system : lando
2019-09-25 12:38:20 +00:00
Michal Novotny
815ac794a5 Bug 1561944 - Implement nsINetworkLinkService.networkID for Android r=valentin
Patch changes nsAndroidNetworkLinkService so it uses NetlinkService for network ID calculation as well as for notifications about network changes.

Differential Revision: https://phabricator.services.mozilla.com/D43385

--HG--
extra : moz-landing-system : lando
2019-09-19 13:47:46 +00:00
Jeremy Lempereur
c3d1703996 Bug 1580157 - Add tests to network attributes sorting. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D45893

--HG--
extra : moz-landing-system : lando
2019-09-17 18:58:39 +00:00
Valentin Gosu
54d27f2b21 Bug 1576386 - Set a 2 second timeout when shutting down the Link Monitor thread r=mayhemer
The thread calls into some windows APIs that may sometimes block for a long time. Since we're shutting down anyway, it is OK to sometimes leak this thread, similar to what we do for DNS resolver threads.

The patch converts nsNotifyAddrListener::mThread to a nsIThreadPool (with a max of 1 thread) so that we may call shutdownWithTimeout on it.

Differential Revision: https://phabricator.services.mozilla.com/D46002

--HG--
extra : moz-landing-system : lando
2019-09-17 11:38:49 +00:00
Valentin Gosu
03918d82cc Bug 1580130 - Call calculateNetworkId() after every CheckAdaptersAddresses r=dragana
Since we sometimes coalesce SendEvents, calling it from there is not actually correct, and sometimes we fail to recompute the networkID when network changes happen.

Differential Revision: https://phabricator.services.mozilla.com/D45331

--HG--
extra : moz-landing-system : lando
2019-09-13 06:41:37 +00:00
Valentin Gosu
078dddfc0a Bug 1576386 - Don't recompute the networkId during shutdown r=michal
Calling the windows APIs may block shutdown.

Differential Revision: https://phabricator.services.mozilla.com/D45161

--HG--
extra : moz-landing-system : lando
2019-09-11 14:38:52 +00:00
Jeremy Lempereur
28fa1df24e Bug 1562386 - Sort network attributes before hashing them to get a networkID r=mayhemer,michal,valentin
Differential Revision: https://phabricator.services.mozilla.com/D38418

--HG--
extra : moz-landing-system : lando
2019-09-10 11:02:25 +00:00
Brindusan Cristian
41e89721b3 Backed out changeset 566627a48370 (bug 1562386) for bustages on nsNotifyAddrListener.cpp:222:21. CLOSED TREE
--HG--
extra : histedit_source : d26c75e2ded633ed92ce294faf94e2c9ec259c74
2019-09-09 14:28:10 +03:00
Jeremy Lempereur
d70444d071 Bug 1562386 - Sort network attributes before hashing them to get a networkID r=mayhemer,michal
Differential Revision: https://phabricator.services.mozilla.com/D38418

--HG--
extra : moz-landing-system : lando
2019-09-06 10:12:51 +00:00
Michal Novotny
a9aa8451c2 Bug 1570932 - Add telemetry about how often we observe network change events, r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D44215

--HG--
extra : moz-landing-system : lando
2019-08-30 18:18:19 +00:00
Michal Novotny
19c05de902 Bug 1576826 - Intermittent Assertion failure: isResponse, at NetlinkService.cpp:613, r=kershaw
Obviously broadcasted messages can be multipart too.

Differential Revision: https://phabricator.services.mozilla.com/D43849

--HG--
extra : moz-landing-system : lando
2019-08-29 12:08:53 +00:00
Michal Novotny
390918caab Bug 1567616 - network id based on default gateway is wrong when VPN overrides default gateway by more specific routes r=dragana
This patch implements NetlinkService which communicates with kernel via netlink socket. It keeps track of addresses, default routes, interfaces and neighbors and uses it to calculate network ID.

Differential Revision: https://phabricator.services.mozilla.com/D43175

--HG--
rename : netwerk/system/linux/nsNotifyAddrListener_Linux.cpp => netwerk/system/linux/nsNetworkLinkService.cpp
rename : netwerk/system/linux/nsNotifyAddrListener_Linux.h => netwerk/system/linux/nsNetworkLinkService.h
extra : moz-landing-system : lando
2019-08-26 21:46:32 +00:00
Andreea Pavel
f042d32425 Backed out changeset 22469090e93e (bug 1567616) for build bustages on a CLOSED TREE
--HG--
rename : netwerk/system/linux/nsNetworkLinkService.cpp => netwerk/system/linux/nsNotifyAddrListener_Linux.cpp
rename : netwerk/system/linux/nsNetworkLinkService.h => netwerk/system/linux/nsNotifyAddrListener_Linux.h
2019-08-27 00:30:40 +03:00
Michal Novotny
128254f45e Bug 1567616 - network id based on default gateway is wrong when VPN overrides default gateway by more specific routes r=dragana
This patch implements NetlinkService which communicates with kernel via netlink socket. It keeps track of addresses, default routes, interfaces and neighbors and uses it to calculate network ID.

Differential Revision: https://phabricator.services.mozilla.com/D43175

--HG--
rename : netwerk/system/linux/nsNotifyAddrListener_Linux.cpp => netwerk/system/linux/nsNetworkLinkService.cpp
rename : netwerk/system/linux/nsNotifyAddrListener_Linux.h => netwerk/system/linux/nsNetworkLinkService.h
extra : moz-landing-system : lando
2019-08-26 20:03:33 +00:00
Kershaw Chang
50cb9b047f Bug 1568898 - Calaulate network id when ip changed r=michal
Differential Revision: https://phabricator.services.mozilla.com/D39699

--HG--
extra : moz-landing-system : lando
2019-08-13 16:48:05 +00:00
Kershaw Chang
91a9c98998 Bug 1564960 - Calaulate network id on stream transport thread r=michal
Differential Revision: https://phabricator.services.mozilla.com/D39020

--HG--
extra : moz-landing-system : lando
2019-08-14 13:20:25 +00:00
Michal Novotny
82a7200c4b Bug 1561273 - network ID: ipv4NetworkId/scanArp returns gateway IP instead of its MAC, r=kershaw
This patch fixes a bug in ipv4NetworkId where we wrongly hashed IP address instead of MAC address. It also simplifies getMac function. MAC address must be 6 bytes long. If it's not it's probably an error and we must not use it.

Differential Revision: https://phabricator.services.mozilla.com/D39349

--HG--
extra : moz-landing-system : lando
2019-07-26 12:29:01 +00:00
Valentin Gosu
7ab22ff110 Bug 1561005 - Add empty GetNetworkID impl for Android r=michal
Differential Revision: https://phabricator.services.mozilla.com/D35883

--HG--
extra : moz-landing-system : lando
2019-06-28 11:42:05 +00:00
Valentin Gosu
49e0220e23 Bug 1561005 - Implement nsINetworkLinkService.networkID on mac r=michal
Depends on D35780

Differential Revision: https://phabricator.services.mozilla.com/D35781

--HG--
extra : moz-landing-system : lando
2019-06-28 12:41:27 +00:00
Valentin Gosu
c657dcfafe Bug 1561005 - Implement nsINetworkLinkService.networkID on Linux r=michal
* calculateNetworkId is now called before sending each ChangeEvent
* mNetworkId is truncated when no IPv4/IPv6 IDs could be computed

Differential Revision: https://phabricator.services.mozilla.com/D35780

--HG--
extra : moz-landing-system : lando
2019-06-28 11:42:09 +00:00
Valentin Gosu
7aa44d1987 Bug 1561005 - Make windows networkID use the INetworkListManager API r=mayhemer,michal
Depends on D35683

Differential Revision: https://phabricator.services.mozilla.com/D35684

--HG--
extra : moz-landing-system : lando
2019-06-28 16:35:22 +00:00
Valentin Gosu
ce90534047 Bug 1561005 - Add nsINetworkLinkService.networkID r=michal
Differential Revision: https://phabricator.services.mozilla.com/D35683

--HG--
extra : moz-landing-system : lando
2019-06-28 11:42:12 +00:00
Valentin Gosu
e19cd483fd Bug 1395914 - Update histogram with two new values for IPv6 network-id changes r=michal
Differential Revision: https://phabricator.services.mozilla.com/D34905

--HG--
extra : moz-landing-system : lando
2019-06-28 11:42:14 +00:00
Valentin Gosu
18173f21d2 Bug 1395914 - Figure out network id for IPv6 too (mac) r=michal
Differential Revision: https://phabricator.services.mozilla.com/D34904

--HG--
extra : moz-landing-system : lando
2019-06-28 11:42:16 +00:00
Valentin Gosu
1fc5fb9a40 Bug 1395914 - Figure out network id for IPv6 too (Linux) r=michal
Differential Revision: https://phabricator.services.mozilla.com/D34903

--HG--
extra : moz-landing-system : lando
2019-06-28 11:42:18 +00:00
Mihai Alexandru Michis
ff9ddc0bc1 Backed out 8 changesets (bug 1395914, bug 1561005) for causing bustages in nsNetworkLinkService and nsNotifyAddrListener.cpp CLOSED TREE
Backed out changeset c552aeab0fbf (bug 1561005)
Backed out changeset 61cf9ae8abcf (bug 1561005)
Backed out changeset 5c33e521c0e8 (bug 1561005)
Backed out changeset 82eeb4c5e535 (bug 1561005)
Backed out changeset 6b3b29de9c78 (bug 1561005)
Backed out changeset 719b3b61b9a9 (bug 1395914)
Backed out changeset 2b23587aa5ff (bug 1395914)
Backed out changeset 47f2f3e8d5f9 (bug 1395914)
2019-06-28 14:37:13 +03:00
Valentin Gosu
8673cb0d40 Bug 1561005 - Add empty GetNetworkID impl for Android r=michal
Differential Revision: https://phabricator.services.mozilla.com/D35883

--HG--
extra : moz-landing-system : lando
2019-06-27 09:03:28 +00:00
Valentin Gosu
1d08465e38 Bug 1561005 - Implement nsINetworkLinkService.networkID on mac r=michal
Differential Revision: https://phabricator.services.mozilla.com/D35781

--HG--
extra : moz-landing-system : lando
2019-06-27 09:03:11 +00:00
Valentin Gosu
20a97e21d6 Bug 1561005 - Implement nsINetworkLinkService.networkID on Linux r=michal
* calculateNetworkId is now called before sending each ChangeEvent
* mNetworkId is truncated when no IPv4/IPv6 IDs could be computed

Differential Revision: https://phabricator.services.mozilla.com/D35780

--HG--
extra : moz-landing-system : lando
2019-06-27 09:02:59 +00:00