about summary refs log tree commit diff
path: root/src/ppp-manager/nm-ppp-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ppp-manager/nm-ppp-manager.c')
-rw-r--r--src/ppp-manager/nm-ppp-manager.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c
index 89a7addf..a51f7cfa 100644
--- a/src/ppp-manager/nm-ppp-manager.c
+++ b/src/ppp-manager/nm-ppp-manager.c
@@ -482,7 +482,7 @@ impl_ppp_manager_set_ip4_config (NMPPPManager *manager,
 		address.plen = u32;
 
 	if (address.address && address.plen && address.plen <= 32) {
-		address.source = NM_IP_CONFIG_SOURCE_PPP;
+		address.addr_source = NM_IP_CONFIG_SOURCE_PPP;
 		nm_ip4_config_add_address (config, &address);
 	} else {
 		_LOGE ("invalid IPv4 address received!");
@@ -540,7 +540,7 @@ iid_value_to_ll6_addr (GVariant *dict,
 	out_addr->s6_addr16[0] = htons (0xfe80);
 	memcpy (out_addr->s6_addr + 8, &iid, sizeof (iid));
 	if (out_iid)
-		nm_utils_ipv6_interface_identfier_get_from_addr (out_iid, out_addr);
+		nm_utils_ipv6_interface_identifier_get_from_addr (out_iid, out_addr);
 	return TRUE;
 }
 
@@ -1028,7 +1028,7 @@ nm_ppp_manager_start (NMPPPManager *manager,
 	NMPPPManagerPrivate *priv;
 	NMConnection *connection;
 	NMSettingPpp *s_ppp;
-	gboolean s_ppp_created = FALSE;
+	gs_unref_object NMSettingPpp *s_ppp_free = NULL;
 	NMSettingPppoe *pppoe_setting;
 	NMSettingAdsl *adsl_setting;
 	NMCmdLine *ppp_cmd;
@@ -1056,24 +1056,21 @@ nm_ppp_manager_start (NMPPPManager *manager,
 		nm_utils_modprobe (NULL, FALSE, "ppp_generic", NULL);
 
 	connection = nm_act_request_get_applied_connection (req);
-	g_assert (connection);
+	g_return_val_if_fail (connection, FALSE);
 
 	s_ppp = nm_connection_get_setting_ppp (connection);
 	if (!s_ppp) {
 		/* If the PPP settings are all default we may not have a PPP setting yet,
 		 * so just make a default one here.
 		 */
-		s_ppp = NM_SETTING_PPP (nm_setting_ppp_new ());
-		s_ppp_created = TRUE;
+		s_ppp = s_ppp_free = NM_SETTING_PPP (nm_setting_ppp_new ());
 	}
-	
+
 	pppoe_setting = nm_connection_get_setting_pppoe (connection);
 	if (pppoe_setting) {
 		/* We can't modify the applied connection's setting, make a copy */
-		if (!s_ppp_created) {
-			s_ppp = NM_SETTING_PPP (nm_setting_duplicate ((NMSetting *) s_ppp));
-			s_ppp_created = TRUE;
-		}
+		if (!s_ppp_free)
+			s_ppp = s_ppp_free = NM_SETTING_PPP (nm_setting_duplicate ((NMSetting *) s_ppp));
 		pppoe_fill_defaults (s_ppp);
 	}
 
@@ -1106,9 +1103,6 @@ nm_ppp_manager_start (NMPPPManager *manager,
 	priv->act_req = g_object_ref (req);
 
 out:
-	if (s_ppp_created)
-		g_object_unref (s_ppp);
-
 	if (ppp_cmd)
 		nm_cmd_line_destroy (ppp_cmd);