diff options
author | Thomas Haller <thaller@redhat.com> | 2019-04-03 11:29:33 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-04-03 11:29:33 +0200 |
commit | d469421669453ffd4b496236faa6c280eef48b58 (patch) | |
tree | 4050cada1908f8d0cd1c040ff2c5f93f6545137e | |
parent | 4c4dbcb78d5b9427434c46c6952d6518b2e66562 (diff) | |
download | NetworkManager-d469421669453ffd4b496236faa6c280eef48b58.tar.gz |
connectivity/trivial: add code comment
-rw-r--r-- | src/devices/nm-device.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 60162f4399..2618432d43 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -2788,8 +2788,10 @@ nm_device_check_connectivity_update_interval (NMDevice *self) } static void -concheck_update_state (NMDevice *self, int addr_family, - NMConnectivityState state, gboolean allow_periodic_bump) +concheck_update_state (NMDevice *self, + int addr_family, + NMConnectivityState state, + gboolean allow_periodic_bump) { NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); const gboolean IS_IPv4 = (addr_family == AF_INET); @@ -2822,8 +2824,15 @@ concheck_update_state (NMDevice *self, int addr_family, state = NM_CONNECTIVITY_LIMITED; } else state = NM_CONNECTIVITY_NONE; - } else if (state == NM_CONNECTIVITY_LIMITED && priv->state <= NM_DEVICE_STATE_DISCONNECTED) - 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) { /* we got a connectivty update, but the state didn't change. If we were probing, |