From aa055239a226252b6a74028b29fbc142220daffa Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 18 Jun 2019 09:38:38 +0200 Subject: [PATCH] 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 4c4dbcb78d5b9427434c46c6952d6518b2e66562. (cherry picked from commit 5a416a9da1ac72241933fb52e2a361a87a6cfe66) --- src/devices/nm-device.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index cd6d5bc181..e9128a25cf 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -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) {