This patch makes network change event different from network ID change event on Linux and Android. Network change event is now also sent when any address has been added, removed or changed.
Differential Revision: https://phabricator.services.mozilla.com/D53796
--HG--
extra : moz-landing-system : lando
- removes nsNotifyAddrListener::ChangeEvent in favour of NS_NewRunnableFunction
- adds new topic for network ID change notification
Differential Revision: https://phabricator.services.mozilla.com/D52689
--HG--
extra : moz-landing-system : lando
This patch adds network ID change event to Linux and Android. On these platforms network ID change event is equal to network change event.
Differential Revision: https://phabricator.services.mozilla.com/D50391
--HG--
extra : moz-landing-system : lando
This code was added in bug 465158 to deal with on-demand dial-up
connections. That scenario is hopefully not common anymore.
One benefit of the code was that it excludes network adapters
that share the computers network from being part of network
change notifications, network ID, etc. However, the code assumed
that only adapters with the address 192.168.0.1 would be a ICS
adapter, but trying to set up ICS on Windows 10 actually set the
LAN interface with 192.168.137.1 - so that assumption isn't
valid anymore. So the code is likely not even running for
adapters that are ICS. It may run for adapters which have the
IP 192.168.0.1, but probably that's quite rare as that's more
often a gateway IP than a client IP.
In any case, it's better to just get rid of it and if needed,
however unlikely, we'll replace it with a more modern API.
Depends on D52573
Differential Revision: https://phabricator.services.mozilla.com/D52574
--HG--
extra : moz-landing-system : lando
Old code needed to dynamically load a DLL - which was not available
for windows versions prior to Vista, and if that failed it would
fall back to using an older API.
This patch now calls the methods directly, since we don't have to
worry about the library not being there; we also remove the
fallback, meaning we always call NotifyIpInterfaceChange instead
of falling back to NotifyAddrChange.
Differential Revision: https://phabricator.services.mozilla.com/D52573
--HG--
extra : moz-landing-system : lando
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
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
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
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
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
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
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
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
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
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
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