Revert "Coerce connectivity "LIMITED" to "NONE" when device is disconnected"

NMConnectivity can now distinguish between LIMITED and NONE connectivity
and it does so based on whether IP addresses and routes are configured.

Previously, NMConnectivity would not differenciate between limited and
no connectivity, which is why NMDevice added some additional logic on top
to coerce LIMITED to NONE (if the device is not logically connected).

But note that the connectivity state (whether a network is reachable on
an interface) depends on what is configured in kernel and whether the
internet is reachable on that interface. It does not depend on the
logical device state.

On the other hand, whether the device is configured in a manner to have
connectivity depends on the logical state of the device (as NetworkManager
is configuring the device).

So, in many cases, the logical state and the connectivity state agree now,
but for the right reasons.

This reverts commit 4c4dbcb78d.

(cherry picked from commit 5a416a9da1)
This commit is contained in:
Thomas Haller 2019-06-18 09:38:38 +02:00 committed by Beniamino Galvani
parent a842280dbe
commit aa055239a2

View file

@ -2825,14 +2825,6 @@ concheck_update_state (NMDevice *self,
state = NM_CONNECTIVITY_LIMITED;
} else
state = NM_CONNECTIVITY_NONE;
} else if (state == NM_CONNECTIVITY_LIMITED) {
/* NMConnectivity cannot distinguish between NONE and LIMITED connectivity. In both
* cases, it just failed to fetch the URL.
*
* NMDevice coerces a LIMITED state to NONE here, if the logical state of the device
* is disconnected. */
if (priv->state <= NM_DEVICE_STATE_DISCONNECTED)
state = NM_CONNECTIVITY_NONE;
}
if (priv->concheck_x[IS_IPv4].state == state) {