connectivity/trivial: add code comment

This commit is contained in:
Thomas Haller 2019-04-03 11:29:33 +02:00
parent 4c4dbcb78d
commit d469421669

View file

@ -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,