summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/NetworkManagerUtils.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c
index b7a2faaa17..596c5bb362 100644
--- a/src/NetworkManagerUtils.c
+++ b/src/NetworkManagerUtils.c
@@ -175,32 +175,24 @@ nm_utils_get_ip_config_method (NMConnection *connection,
if (ip_setting_type == NM_TYPE_SETTING_IP4_CONFIG) {
g_return_val_if_fail (s_con != NULL, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
- if (nm_setting_connection_get_master (s_con))
+ s_ip4 = nm_connection_get_setting_ip4_config (connection);
+ if (!s_ip4)
return NM_SETTING_IP4_CONFIG_METHOD_DISABLED;
- else {
- s_ip4 = nm_connection_get_setting_ip4_config (connection);
- if (!s_ip4)
- return NM_SETTING_IP4_CONFIG_METHOD_DISABLED;
- method = nm_setting_ip_config_get_method (s_ip4);
- g_return_val_if_fail (method != NULL, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
-
- return method;
- }
+ method = nm_setting_ip_config_get_method (s_ip4);
+ g_return_val_if_fail (method != NULL, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
+
+ return method;
} else if (ip_setting_type == NM_TYPE_SETTING_IP6_CONFIG) {
g_return_val_if_fail (s_con != NULL, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
- if (nm_setting_connection_get_master (s_con))
+ s_ip6 = nm_connection_get_setting_ip6_config (connection);
+ if (!s_ip6)
return NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
- else {
- s_ip6 = nm_connection_get_setting_ip6_config (connection);
- if (!s_ip6)
- return NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
- method = nm_setting_ip_config_get_method (s_ip6);
- g_return_val_if_fail (method != NULL, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
-
- return method;
- }
+ method = nm_setting_ip_config_get_method (s_ip6);
+ g_return_val_if_fail (method != NULL, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
+
+ return method;
} else
g_assert_not_reached ();