summaryrefslogtreecommitdiff
path: root/src/devices/nm-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r--src/devices/nm-device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 603924558c..541f1eb5e8 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -1499,18 +1499,20 @@ nm_device_get_priority (NMDevice *self)
static guint32
route_metric_with_penalty (NMDevice *self, guint32 metric)
{
+#if WITH_CONCHECK
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
const guint32 PENALTY = 20000;
/* Beware: for IPv6, a metric of 0 effectively means 1024.
* Only pass a normalized IPv6 metric (nm_utils_ip6_route_metric_normalize). */
- if (priv->connectivity_state != NM_CONNECTIVITY_FULL) {
+ if ( priv->connectivity_state != NM_CONNECTIVITY_FULL
+ && nm_connectivity_check_enabled (nm_connectivity_get ())) {
if (metric >= G_MAXUINT32 - PENALTY)
return G_MAXUINT32;
return metric + PENALTY;
}
-
+#endif
return metric;
}