Blame SOURCES/0026-apply-route-penality-only-with-defroute-rh1459604.patch

fc9aca
From 5b1e11d056015e70431f4add8a5efd203d14775f Mon Sep 17 00:00:00 2001
fc9aca
From: Beniamino Galvani <bgalvani@redhat.com>
fc9aca
Date: Thu, 8 Jun 2017 00:26:00 +0200
fc9aca
Subject: [PATCH] device: apply route metric penality only when the default
fc9aca
 route exists
fc9aca
fc9aca
It's useless (and in some cases also harmful) to commit the
fc9aca
configuration to update the default route metric when the device has
fc9aca
no default route. Also, don't commit configuration for externally
fc9aca
activated devices.
fc9aca
fc9aca
https://bugzilla.redhat.com/show_bug.cgi?id=1459604
fc9aca
(cherry picked from commit aa099906f93264bda3ae34fca4dfbdde5455b2bb)
fc9aca
(cherry picked from commit 6a4774b1a8fdc346e0a2d2a3d2ec43054190fdc5)
fc9aca
---
fc9aca
 src/devices/nm-device.c | 9 ++++++---
fc9aca
 1 file changed, 6 insertions(+), 3 deletions(-)
fc9aca
fc9aca
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
fc9aca
index 6c93a95..e60995d 100644
fc9aca
--- a/src/devices/nm-device.c
fc9aca
+++ b/src/devices/nm-device.c
fc9aca
@@ -1827,10 +1827,13 @@ update_connectivity_state (NMDevice *self, NMConnectivityState state)
fc9aca
 		priv->connectivity_state = state;
fc9aca
 		_notify (self, PROP_CONNECTIVITY);
fc9aca
 
fc9aca
-		if (nm_device_get_state (self) == NM_DEVICE_STATE_ACTIVATED) {
fc9aca
-			if (!ip4_config_merge_and_apply (self, NULL, TRUE))
fc9aca
+		if (   priv->state == NM_DEVICE_STATE_ACTIVATED
fc9aca
+		    && !nm_device_sys_iface_state_is_external (self)) {
fc9aca
+			if (   priv->default_route.v4_has
fc9aca
+			    && !ip4_config_merge_and_apply (self, NULL, TRUE))
fc9aca
 				_LOGW (LOGD_IP4, "Failed to update IPv4 default route metric");
fc9aca
-			if (!ip6_config_merge_and_apply (self, TRUE))
fc9aca
+			if (   priv->default_route.v6_has
fc9aca
+			    && !ip6_config_merge_and_apply (self, TRUE))
fc9aca
 				_LOGW (LOGD_IP6, "Failed to update IPv6 default route metric");
fc9aca
 		}
fc9aca
 	}
fc9aca
-- 
fc9aca
2.9.3
fc9aca