Blame SOURCES/0014-device-skip-IP-conf-for-external-devices-rh1530288.patch

c48088
From d07570b2dad62b582f39310f4abea036060f85a0 Mon Sep 17 00:00:00 2001
c48088
From: Beniamino Galvani <bgalvani@redhat.com>
c48088
Date: Thu, 18 Jan 2018 11:43:09 +0100
c48088
Subject: [PATCH] device: skip IP configuration phase for external devices
c48088
c48088
We already avoid committing the IP configuration for external devices
c48088
(see commit 60334a2893fe). However, we still start DHCP/IPv6-autoconf
c48088
and, especially, we change sysctl values of the device.
c48088
c48088
To be sure that no action is taken on the device, return early from
c48088
the IP configuration phase, as in the method=disabled/ignore case.
c48088
c48088
https://bugzilla.redhat.com/show_bug.cgi?id=1530288
c48088
(cherry picked from commit 22f32a16f5aa0a24fd124ad5788959936e22acff)
c48088
(cherry picked from commit a169247b7dda0c27707861e6cbc808ecfd4c5e85)
c48088
---
c48088
 src/devices/nm-device.c | 12 ++++++++++++
c48088
 1 file changed, 12 insertions(+)
c48088
c48088
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
c48088
index babef21ad..b3b31ea45 100644
c48088
--- a/src/devices/nm-device.c
c48088
+++ b/src/devices/nm-device.c
c48088
@@ -8159,6 +8159,12 @@ nm_device_activate_stage3_ip4_start (NMDevice *self)
c48088
 
c48088
 	g_assert (priv->ip4_state == IP_WAIT);
c48088
 
c48088
+	if (nm_device_sys_iface_state_is_external (self)) {
c48088
+		_set_ip_state (self, AF_INET, IP_DONE);
c48088
+		check_ip_state (self, FALSE);
c48088
+		return TRUE;
c48088
+	}
c48088
+
c48088
 	_set_ip_state (self, AF_INET, IP_CONF);
c48088
 	ret = NM_DEVICE_GET_CLASS (self)->act_stage3_ip4_config_start (self, &ip4_config, &failure_reason);
c48088
 	if (ret == NM_ACT_STAGE_RETURN_SUCCESS) {
c48088
@@ -8200,6 +8206,12 @@ nm_device_activate_stage3_ip6_start (NMDevice *self)
c48088
 
c48088
 	g_assert (priv->ip6_state == IP_WAIT);
c48088
 
c48088
+	if (nm_device_sys_iface_state_is_external (self)) {
c48088
+		_set_ip_state (self, AF_INET6, IP_DONE);
c48088
+		check_ip_state (self, FALSE);
c48088
+		return TRUE;
c48088
+	}
c48088
+
c48088
 	_set_ip_state (self, AF_INET6, IP_CONF);
c48088
 	ret = NM_DEVICE_GET_CLASS (self)->act_stage3_ip6_config_start (self, &ip6_config, &failure_reason);
c48088
 	if (ret == NM_ACT_STAGE_RETURN_SUCCESS) {
c48088
-- 
c48088
2.14.3
c48088