Blame SOURCES/0007-device-update-ext-conf-before-commit-rh1449873.patch

fc9aca
From b870115d83ddb2f7091e7b5e1f65b64261c53557 Mon Sep 17 00:00:00 2001
fc9aca
From: Beniamino Galvani <bgalvani@redhat.com>
fc9aca
Date: Fri, 12 May 2017 12:00:20 +0200
fc9aca
Subject: [PATCH 1/2] device: update external configuration before commit
fc9aca
fc9aca
If the platform signaled that the external configuration changed (and
fc9aca
thus update_ipX_config() is scheduled) and we are doing a commit of
fc9aca
the new configuration, update priv->ext_ipX_config. Without this, the
fc9aca
commit will remove addresses added externally but not yet captured in
fc9aca
the external configuration.
fc9aca
fc9aca
https://bugzilla.redhat.com/show_bug.cgi?id=1449873
fc9aca
(cherry picked from commit a21b8882cc9defc43248afc94bf59ca0f84f0d27)
fc9aca
(cherry picked from commit bf5407992f54440b586e1d0b3792f93eb2c464f3)
fc9aca
---
fc9aca
 src/devices/nm-device.c | 21 +++++++++++++++++++--
fc9aca
 1 file changed, 19 insertions(+), 2 deletions(-)
fc9aca
fc9aca
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
fc9aca
index 8540b4c..87cd296 100644
fc9aca
--- a/src/devices/nm-device.c
fc9aca
+++ b/src/devices/nm-device.c
fc9aca
@@ -5487,8 +5487,15 @@ ip4_config_merge_and_apply (NMDevice *self,
fc9aca
 	composite = nm_ip4_config_new (nm_device_get_ip_ifindex (self));
fc9aca
 	init_ip4_config_dns_priority (self, composite);
fc9aca
 
fc9aca
-	if (commit)
fc9aca
+	if (commit) {
fc9aca
 		ensure_con_ip4_config (self);
fc9aca
+		if (priv->queued_ip4_config_id) {
fc9aca
+			g_clear_object (&priv->ext_ip4_config);
fc9aca
+			priv->ext_ip4_config = nm_ip4_config_capture (nm_device_get_platform (self),
fc9aca
+			                                              nm_device_get_ifindex (self),
fc9aca
+			                                              FALSE);
fc9aca
+		}
fc9aca
+	}
fc9aca
 
fc9aca
 	if (priv->dev_ip4_config) {
fc9aca
 		nm_ip4_config_merge (composite, priv->dev_ip4_config,
fc9aca
@@ -6223,8 +6230,18 @@ ip6_config_merge_and_apply (NMDevice *self,
fc9aca
 	                           NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN);
fc9aca
 	init_ip6_config_dns_priority (self, composite);
fc9aca
 
fc9aca
-	if (commit)
fc9aca
+	if (commit) {
fc9aca
 		ensure_con_ip6_config (self);
fc9aca
+		if (priv->queued_ip6_config_id) {
fc9aca
+			g_clear_object (&priv->ext_ip6_config);
fc9aca
+			g_clear_object (&priv->ext_ip6_config_captured);
fc9aca
+			priv->ext_ip6_config_captured = nm_ip6_config_capture (nm_device_get_platform (self),
fc9aca
+			                                                       nm_device_get_ifindex (self),
fc9aca
+			                                                       FALSE,
fc9aca
+			                                                       NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN);
fc9aca
+			priv->ext_ip6_config = nm_ip6_config_new_cloned (priv->ext_ip6_config_captured);
fc9aca
+		}
fc9aca
+	}
fc9aca
 
fc9aca
 	/* Merge all the IP configs into the composite config */
fc9aca
 	if (priv->ac_ip6_config) {
fc9aca
-- 
fc9aca
2.9.3
fc9aca
fc9aca
From 2d0d1643e59f4ac935e2288a02da8774b6b237dc Mon Sep 17 00:00:00 2001
fc9aca
From: Beniamino Galvani <bgalvani@redhat.com>
fc9aca
Date: Wed, 17 May 2017 09:46:22 +0200
fc9aca
Subject: [PATCH 2/2] device: fix crash in ip6_config_merge_and_apply()
fc9aca
fc9aca
nm_ip6_config_capture() returns NULL for slaves. Fixes the following:
fc9aca
fc9aca
 nm_ip6_config_new_cloned: assertion 'NM_IS_IP6_CONFIG (src)' failed
fc9aca
fc9aca
 #0 g_logv () at /lib64/libglib-2.0.so.0
fc9aca
 #1 g_log () at /lib64/libglib-2.0.so.0
fc9aca
 #2 nm_ip6_config_new_cloned (src=0x0) at src/nm-ip6-config.c:2272
fc9aca
 #3 ip6_config_merge_and_apply (self=self@entry=0x200d8f0, commit=commit@entry=1) at src/devices/nm-device.c:6192
fc9aca
 #4 nm_device_bring_up (self=self@entry=0x200d8f0, block=block@entry=1, no_firmware=no_firmware@entry=0x0) at src/devices/nm-device.c:10369
fc9aca
 #5 _hw_addr_set (self=self@entry=0x200d8f0, addr=addr@entry=0x2095ea0 "6A:1C:00:2A:68:7C", operation=operation@entry=0x64f8ba "set", detail=detail@entry=0x67369d "restore") at src/devices/nm-device.c:13225
fc9aca
 #6 nm_device_hw_addr_set (self=self@entry=0x200d8f0, addr=addr@entry=0x2095ea0 "6A:1C:00:2A:68:7C", detail=detail@entry=0x67369d "restore", set_permanent=set_permanent@entry=0) at src/devices/nm-device.c:13255
fc9aca
 #7 release_slave (device=0x200d8f0, slave=0x1ef2990, configure=<optimized out>) at src/devices/nm-device-bond.c:463
fc9aca
 #8 nm_device_master_release_one_slave (self=self@entry=0x200d8f0, slave=slave@entry=0x1ef2990, configure=1, reason=reason@entry=NM_DEVICE_STATE_REASON_CONNECTION_REMOVED) at src/devices/nm-device.c:2041
fc9aca
 #9 slave_state_changed (slave=0x1ef2990, slave_new_state=NM_DEVICE_STATE_DEACTIVATING, slave_old_state=NM_DEVICE_STATE_ACTIVATED, reason=NM_DEVICE_STATE_REASON_CONNECTION_REMOVED, self=0x200d8f0)
fc9aca
     at src/devices/nm-device.c:3366
fc9aca
 ...
fc9aca
fc9aca
Fixes: a21b8882cc9defc43248afc94bf59ca0f84f0d27
fc9aca
(cherry picked from commit 1e78f50b8e5e24d13547b478165170117c1ac8ae)
fc9aca
(cherry picked from commit bf28e0845fa38cdd3556fb61a7e725ac42a7d50a)
fc9aca
---
fc9aca
 src/devices/nm-device.c | 3 ++-
fc9aca
 1 file changed, 2 insertions(+), 1 deletion(-)
fc9aca
fc9aca
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
fc9aca
index 87cd296..b14dc49 100644
fc9aca
--- a/src/devices/nm-device.c
fc9aca
+++ b/src/devices/nm-device.c
fc9aca
@@ -6239,7 +6239,8 @@ ip6_config_merge_and_apply (NMDevice *self,
fc9aca
 			                                                       nm_device_get_ifindex (self),
fc9aca
 			                                                       FALSE,
fc9aca
 			                                                       NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN);
fc9aca
-			priv->ext_ip6_config = nm_ip6_config_new_cloned (priv->ext_ip6_config_captured);
fc9aca
+			if (priv->ext_ip6_config_captured)
fc9aca
+				priv->ext_ip6_config = nm_ip6_config_new_cloned (priv->ext_ip6_config_captured);
fc9aca
 		}
fc9aca
 	}
fc9aca
 
fc9aca
-- 
fc9aca
2.9.3
fc9aca
fc9aca
From 8a7f6f2cd2c210a29daae39b1d0b0923d78d3ed0 Mon Sep 17 00:00:00 2001
fc9aca
From: Beniamino Galvani <bgalvani@redhat.com>
fc9aca
Date: Sun, 21 May 2017 15:47:33 +0200
fc9aca
Subject: [PATCH] device: fix capture of device config in
fc9aca
 ipX_config_merge_and_apply()
fc9aca
fc9aca
Use nm_device_get_ip_ifindex() to obtain the right ifindex for the
fc9aca
device. Fixes the following:
fc9aca
fc9aca
 nm_platform_ip4_address_get_all: assertion 'ifindex > 0' failed
fc9aca
 #0  _g_log_abort () from target:/lib64/libglib-2.0.so.0
fc9aca
 #1  g_logv () from target:/lib64/libglib-2.0.so.0
fc9aca
 #2  g_log () from target:/lib64/libglib-2.0.so.0
fc9aca
 #3  nm_platform_ip4_address_get_all (self=self@entry=0x1181020, ifindex=ifindex@entry=0) at src/platform/nm-platform.c:2640
fc9aca
 #4  nm_ip4_config_capture (platform=0x1181020, ifindex=ifindex@entry=0, capture_resolv_conf=capture_resolv_conf@entry=0) at src/nm-ip4-config.c:271
fc9aca
 #5  ip4_config_merge_and_apply (self=self@entry=0x1254a70, config=config@entry=0x0, commit=commit@entry=1) at src/devices/nm-device.c:5447
fc9aca
 #6  activate_stage5_ip4_config_commit (self=0x1254a70) at src/devices/nm-device.c:8299
fc9aca
 #7  activation_source_handle_cb (self=0x1254a70, family=family@entry=2) at src/devices/nm-device.c:4421
fc9aca
 #8  activation_source_handle_cb4 (user_data=<optimized out>) at src/devices/nm-device.c:4358
fc9aca
 #9  g_idle_dispatch () from target:/lib64/libglib-2.0.so.0
fc9aca
 #10 g_main_context_dispatch () from target:/lib64/libglib-2.0.so.0
fc9aca
 #11 g_main_context_iterate.isra () from target:/lib64/libglib-2.0.so.0
fc9aca
 #12 g_main_loop_run () from target:/lib64/libglib-2.0.so.0
fc9aca
 #13  main (argc=<optimized out>, argv=<optimized out>) at src/main.c:435
fc9aca
fc9aca
Fixes: a21b8882cc9defc43248afc94bf59ca0f84f0d27
fc9aca
(cherry picked from commit 6389d637a7e8d20e037e4bd9cea917dfc372ef17)
fc9aca
(cherry picked from commit 4b6955095b4d857bccb265c22c22b2da2f382d45)
fc9aca
---
fc9aca
 src/devices/nm-device.c | 4 ++--
fc9aca
 1 file changed, 2 insertions(+), 2 deletions(-)
fc9aca
fc9aca
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
fc9aca
index e61bde3..be37116 100644
fc9aca
--- a/src/devices/nm-device.c
fc9aca
+++ b/src/devices/nm-device.c
fc9aca
@@ -5492,7 +5492,7 @@ ip4_config_merge_and_apply (NMDevice *self,
fc9aca
 		if (priv->queued_ip4_config_id) {
fc9aca
 			g_clear_object (&priv->ext_ip4_config);
fc9aca
 			priv->ext_ip4_config = nm_ip4_config_capture (nm_device_get_platform (self),
fc9aca
-			                                              nm_device_get_ifindex (self),
fc9aca
+			                                              nm_device_get_ip_ifindex (self),
fc9aca
 			                                              FALSE);
fc9aca
 		}
fc9aca
 	}
fc9aca
@@ -6236,7 +6236,7 @@ ip6_config_merge_and_apply (NMDevice *self,
fc9aca
 			g_clear_object (&priv->ext_ip6_config);
fc9aca
 			g_clear_object (&priv->ext_ip6_config_captured);
fc9aca
 			priv->ext_ip6_config_captured = nm_ip6_config_capture (nm_device_get_platform (self),
fc9aca
-			                                                       nm_device_get_ifindex (self),
fc9aca
+			                                                       nm_device_get_ip_ifindex (self),
fc9aca
 			                                                       FALSE,
fc9aca
 			                                                       NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN);
fc9aca
 			if (priv->ext_ip6_config_captured)
fc9aca
-- 
fc9aca
2.9.3
fc9aca