File nm-crash-lack-ipv4.patch of Package NetworkManager.import5373

From: Dan Williams <dcbw@redhat.com>
Date: Fri, 14 Jan 2011 20:02:02 +0000
Subject: core: lack of an IPv4 setting indicates DHCP (novell #664640)
Git-commit: 1187922adf7f781cb257b5e119d53a403e3d4831
References: bnc#664640

It shouldn't assert.
Acked-by: Jeff Mahoney <jeffm@suse.com>
---
 src/nm-device.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: NetworkManager-0.8.2/src/nm-device.c
===================================================================
--- NetworkManager-0.8.2.orig/src/nm-device.c
+++ NetworkManager-0.8.2/src/nm-device.c
@@ -3321,7 +3321,7 @@ dispose (GObject *object)
 	if (   nm_device_interface_can_assume_connections (NM_DEVICE_INTERFACE (self))
 	    && (nm_device_get_state (self) == NM_DEVICE_STATE_ACTIVATED)) {
 		NMConnection *connection;
-	    NMSettingIP4Config *s_ip4;
+	    NMSettingIP4Config *s_ip4 = NULL;
 		const char *method = NULL;
 
 		/* Only system connections can be left up */
@@ -3334,9 +3334,8 @@ dispose (GObject *object)
 			 * to check that.
 			 */
 			s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG);
-			g_assert (s_ip4);
-
-			method = nm_setting_ip4_config_get_method (s_ip4);
+			if (s_ip4)
+				method = nm_setting_ip4_config_get_method (s_ip4);
 			if (   !method
 			    || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)
 			    || !strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL))