Blame SOURCES/0007-rh1260243-iface-helper-enabled-slaac.patch

ab7d06
From 60b7ecc242c6b6e485385c045b848702b0e9e0fb Mon Sep 17 00:00:00 2001
ab7d06
From: Thomas Haller <thaller@redhat.com>
ab7d06
Date: Fri, 11 Sep 2015 17:07:23 +0200
ab7d06
Subject: [PATCH 1/1] iface-helper: enabled dhcp4/slaac according to IP method
ab7d06
ab7d06
If at the moment when spawning nm-iface-helper dhcp4/slaac
ab7d06
did not yet complete, we would not enable it.
ab7d06
ab7d06
That is wrong. If the connection indicates to use dhcp4/slaac,
ab7d06
it should be used by nm-iface-helper without considering the
ab7d06
current state on the device.
ab7d06
ab7d06
https://bugzilla.redhat.com/show_bug.cgi?id=1260243
ab7d06
(cherry picked from commit b0815813fa450c40e3a34ce5d6bb9c99aa26e605)
ab7d06
(cherry picked from commit 1ec0b4e7e889b7cedfd1883a48561c35b19cafdf)
ab7d06
---
ab7d06
 src/devices/nm-device.c | 41 ++++++++++++++++++-----------------------
ab7d06
 1 file changed, 18 insertions(+), 23 deletions(-)
ab7d06
ab7d06
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
ab7d06
index b4e9252..d75bf5e 100644
ab7d06
--- a/src/devices/nm-device.c
ab7d06
+++ b/src/devices/nm-device.c
ab7d06
@@ -8206,15 +8206,9 @@ nm_device_spawn_iface_helper (NMDevice *self)
ab7d06
 	dhcp4_address = find_dhcp4_address (self);
ab7d06
 
ab7d06
 	method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG);
ab7d06
-	if (   priv->ip4_config
ab7d06
-	    && priv->ip4_state == IP_DONE
ab7d06
-	    && g_strcmp0 (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0
ab7d06
-	    && priv->dhcp4_client
ab7d06
-	    && dhcp4_address) {
ab7d06
+	if (g_strcmp0 (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO) == 0) {
ab7d06
 		NMSettingIPConfig *s_ip4;
ab7d06
-		GBytes *client_id;
ab7d06
 		char *hex_client_id;
ab7d06
-		const char *hostname;
ab7d06
 
ab7d06
 		s_ip4 = nm_connection_get_setting_ip4_config (connection);
ab7d06
 		g_assert (s_ip4);
ab7d06
@@ -8227,29 +8221,30 @@ nm_device_spawn_iface_helper (NMDevice *self)
ab7d06
 		if (nm_setting_ip_config_get_may_fail (s_ip4) == FALSE)
ab7d06
 			g_ptr_array_add (argv, g_strdup ("--dhcp4-required"));
ab7d06
 
ab7d06
-		client_id = nm_dhcp_client_get_client_id (priv->dhcp4_client);
ab7d06
-		if (client_id) {
ab7d06
-			g_ptr_array_add (argv, g_strdup ("--dhcp4-clientid"));
ab7d06
-			hex_client_id = bin2hexstr (g_bytes_get_data (client_id, NULL),
ab7d06
-			                            g_bytes_get_size (client_id));
ab7d06
-			g_ptr_array_add (argv, hex_client_id);
ab7d06
-		}
ab7d06
+		if (priv->dhcp4_client) {
ab7d06
+			const char *hostname;
ab7d06
+			GBytes *client_id;
ab7d06
 
ab7d06
-		hostname = nm_dhcp_client_get_hostname (priv->dhcp4_client);
ab7d06
-		if (hostname) {
ab7d06
-			g_ptr_array_add (argv, g_strdup ("--dhcp4-hostname"));
ab7d06
-			g_ptr_array_add (argv, g_strdup (hostname));
ab7d06
+			client_id = nm_dhcp_client_get_client_id (priv->dhcp4_client);
ab7d06
+			if (client_id) {
ab7d06
+				g_ptr_array_add (argv, g_strdup ("--dhcp4-clientid"));
ab7d06
+				hex_client_id = bin2hexstr (g_bytes_get_data (client_id, NULL),
ab7d06
+				                            g_bytes_get_size (client_id));
ab7d06
+				g_ptr_array_add (argv, hex_client_id);
ab7d06
+			}
ab7d06
+
ab7d06
+			hostname = nm_dhcp_client_get_hostname (priv->dhcp4_client);
ab7d06
+			if (hostname) {
ab7d06
+				g_ptr_array_add (argv, g_strdup ("--dhcp4-hostname"));
ab7d06
+				g_ptr_array_add (argv, g_strdup (hostname));
ab7d06
+			}
ab7d06
 		}
ab7d06
 
ab7d06
 		configured = TRUE;
ab7d06
 	}
ab7d06
 
ab7d06
 	method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG);
ab7d06
-	if (   priv->ip6_config
ab7d06
-	    && priv->ip6_state == IP_DONE
ab7d06
-	    && g_strcmp0 (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0
ab7d06
-	    && priv->rdisc
ab7d06
-	    && priv->ac_ip6_config) {
ab7d06
+	if (g_strcmp0 (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0) {
ab7d06
 		NMSettingIPConfig *s_ip6;
ab7d06
 		char *hex_iid;
ab7d06
 		NMUtilsIPv6IfaceId iid = NM_UTILS_IPV6_IFACE_ID_INIT;
ab7d06
-- 
ab7d06
2.4.3
ab7d06