Blame SOURCES/1004-device-restore-ipv6-config-on-link-up-rh1548237.patch

a31528
From bb782ab4b2058e0ae14aae1a4c71bd0dc908fbdc Mon Sep 17 00:00:00 2001
a31528
From: Beniamino Galvani <bgalvani@redhat.com>
a31528
Date: Tue, 7 May 2019 16:26:09 +0200
a31528
Subject: [PATCH 1/3] all: fix typos (milli seconds -> milliseconds)
a31528
a31528
(cherry picked from commit 4735d6764a5dc9c3bc6bc09d3220751e789b39c4)
a31528
(cherry picked from commit f6b9366eb4435d7ee45f862dabdefb5f87c4739d)
a31528
---
a31528
 shared/nm-glib-aux/nm-time-utils.c | 2 +-
a31528
 src/devices/nm-device.c            | 2 +-
a31528
 2 files changed, 2 insertions(+), 2 deletions(-)
a31528
a31528
diff --git a/shared/nm-glib-aux/nm-time-utils.c b/shared/nm-glib-aux/nm-time-utils.c
a31528
index ae526c342..98a414595 100644
a31528
--- a/shared/nm-glib-aux/nm-time-utils.c
a31528
+++ b/shared/nm-glib-aux/nm-time-utils.c
a31528
@@ -231,7 +231,7 @@ nm_utils_get_monotonic_timestamp_s (void)
a31528
  * @timestamp: the monotonic-timestamp that should be converted into CLOCK_BOOTTIME.
a31528
  * @timestamp_ns_per_tick: How many nano seconds make one unit of @timestamp? E.g. if
a31528
  * @timestamp is in unit seconds, pass %NM_UTILS_NS_PER_SECOND; @timestamp in nano
a31528
- * seconds, pass 1; @timestamp in milli seconds, pass %NM_UTILS_NS_PER_SECOND/1000; etc.
a31528
+ * seconds, pass 1; @timestamp in milliseconds, pass %NM_UTILS_NS_PER_SECOND/1000; etc.
a31528
  *
a31528
  * Returns: the monotonic-timestamp as CLOCK_BOOTTIME, as returned by clock_gettime().
a31528
  * The unit is the same as the passed in @timestamp basd on @timestamp_ns_per_tick.
a31528
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
a31528
index 8ae64b968..7bf1eb4ce 100644
a31528
--- a/src/devices/nm-device.c
a31528
+++ b/src/devices/nm-device.c
a31528
@@ -3588,7 +3588,7 @@ nm_device_set_carrier (NMDevice *self, gboolean carrier)
a31528
 			now_ms = nm_utils_get_monotonic_timestamp_ms ();
a31528
 			until_ms = NM_MAX (now_ms + _get_carrier_wait_ms (self), priv->carrier_wait_until_ms);
a31528
 			priv->carrier_defer_id = g_timeout_add (until_ms - now_ms, carrier_disconnected_action_cb, self);
a31528
-			_LOGD (LOGD_DEVICE, "carrier: link disconnected (deferring action for %ld milli seconds) (id=%u)",
a31528
+			_LOGD (LOGD_DEVICE, "carrier: link disconnected (deferring action for %ld milliseconds) (id=%u)",
a31528
 			       (long) (until_ms - now_ms), priv->carrier_defer_id);
a31528
 		}
a31528
 	}
a31528
-- 
a31528
2.20.1
a31528
a31528
From ef2113cf7c06d5157ddd2cdc26c1f781b60c477c Mon Sep 17 00:00:00 2001
a31528
From: Beniamino Galvani <bgalvani@redhat.com>
a31528
Date: Tue, 7 May 2019 16:25:04 +0200
a31528
Subject: [PATCH 2/3] device: unconditionally reapply IP configuration on link
a31528
 up
a31528
a31528
Consider the situation in which ipv4.method=auto and there is an
a31528
address configured. Also, the DHCP timeout is long and there is no
a31528
DHCP server. If the link is brought down temporarily, the prefix route
a31528
for the static address is lost and not restored by NM because we
a31528
reapply the IP configuration only when the IP state is DONE.
a31528
a31528
The same can happen also for IPv6, but in that case also static IPv6
a31528
addresses are lost.
a31528
a31528
We should always reapply the IP configuration when the link goes up.
a31528
a31528
(cherry picked from commit d0b16b9283dc16e9db642280be9d6b10a04092a8)
a31528
(cherry picked from commit 4482ca64ba5bbf1c173ea5b4a3854da0173542a8)
a31528
---
a31528
 src/devices/nm-device.c | 12 ++++--------
a31528
 1 file changed, 4 insertions(+), 8 deletions(-)
a31528
a31528
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
a31528
index 7bf1eb4ce..510d9792e 100644
a31528
--- a/src/devices/nm-device.c
a31528
+++ b/src/devices/nm-device.c
a31528
@@ -3890,16 +3890,12 @@ device_link_changed (NMDevice *self)
a31528
 	if (priv->up && (!was_up || seen_down)) {
a31528
 		/* the link was down and just came up. That happens for example, while changing MTU.
a31528
 		 * We must restore IP configuration. */
a31528
-		if (priv->ip_state_4 == NM_DEVICE_IP_STATE_DONE) {
a31528
-			if (!ip_config_merge_and_apply (self, AF_INET, TRUE))
a31528
-				_LOGW (LOGD_IP4, "failed applying IP4 config after link comes up again");
a31528
-		}
a31528
+		if (!ip_config_merge_and_apply (self, AF_INET, TRUE))
a31528
+			_LOGW (LOGD_IP4, "failed applying IP4 config after link comes up again");
a31528
 
a31528
 		priv->linklocal6_dad_counter = 0;
a31528
-		if (priv->ip_state_6 == NM_DEVICE_IP_STATE_DONE) {
a31528
-			if (!ip_config_merge_and_apply (self, AF_INET6, TRUE))
a31528
-				_LOGW (LOGD_IP6, "failed applying IP6 config after link comes up again");
a31528
-		}
a31528
+		if (!ip_config_merge_and_apply (self, AF_INET6, TRUE))
a31528
+			_LOGW (LOGD_IP6, "failed applying IP6 config after link comes up again");
a31528
 	}
a31528
 
a31528
 	if (update_unmanaged_specs)
a31528
-- 
a31528
2.20.1
a31528
a31528
From b3f9c33557951ed90767ff50e9e72e533a211b45 Mon Sep 17 00:00:00 2001
a31528
From: Beniamino Galvani <bgalvani@redhat.com>
a31528
Date: Tue, 7 May 2019 16:32:12 +0200
a31528
Subject: [PATCH 3/3] device: fix intersecting IPv6 configurations
a31528
a31528
If the link is down we shouldn't drop the link-local address from
a31528
configuration as it wasn't removed by user but by kernel.
a31528
a31528
(cherry picked from commit 18d2edfaa13d97597ddf5551e6dd5ea854f1fdbf)
a31528
(cherry picked from commit 6f6914450072b79a91731e042e498ca26892696c)
a31528
---
a31528
 src/devices/nm-device.c | 3 ++-
a31528
 1 file changed, 2 insertions(+), 1 deletion(-)
a31528
a31528
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
a31528
index 510d9792e..06a95110b 100644
a31528
--- a/src/devices/nm-device.c
a31528
+++ b/src/devices/nm-device.c
a31528
@@ -12882,7 +12882,8 @@ update_ext_ip_config (NMDevice *self, int addr_family, gboolean intersect_config
a31528
 				for (iter = priv->vpn_configs_6; iter; iter = iter->next)
a31528
 					nm_ip6_config_intersect (iter->data, priv->ext_ip_config_6, is_up, is_up, 0);
a31528
 
a31528
-				if (   priv->ipv6ll_has
a31528
+				if (   is_up
a31528
+				    && priv->ipv6ll_has
a31528
 				    && !nm_ip6_config_lookup_address (priv->ext_ip_config_6, &priv->ipv6ll_addr))
a31528
 					priv->ipv6ll_has = FALSE;
a31528
 			}
a31528
-- 
a31528
2.20.1
a31528