summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-06-17 12:50:21 +0200
committerLubomir Rintel <lkundrak@v3.sk>2015-06-17 13:17:14 +0200
commit5e8182279a258be04e649f4ae0629eab8e9aaab2 (patch)
tree8e720d8151907e2997b90e31e23b66f4adbb5cc0
parent35dcd8ac33d631c54532aa3bd0b3d2e026ec6407 (diff)
downloadNetworkManager-5e8182279a258be04e649f4ae0629eab8e9aaab2.tar.gz
utils: _get_ip_config_method(): don't assert a connection has IP config
nm_utils_get_shared_wifi_permission() that is called for each AddAndActivate uses this and triggers an assertion failure for InifnibandConnections which don't have IPv4 configuration: NetworkManager[54006]: nm_utils_get_ip_config_method: assertion 's_ip4 != NULL' failed #2 0x000055555562b833 in nm_utils_get_ip_config_method (connection=connection@entry=0x5555559c3b60, ip_setting_type=93824996202304) at NetworkManagerUtils.c:1329 #3 0x000055555562b914 in nm_utils_get_shared_wifi_permission (connection=0x5555559c3b60) at NetworkManagerUtils.c:1105 #4 0x00005555555fc012 in nm_active_connection_authorize (self=0x5555559b30a0, result_func=0x55555561b980 <_add_and_activate_auth_done>, user_data1=0x555555957210, user_data2=0x555555a055f0) at nm-active-connection.c:683 #5 0x0000555555621b21 in impl_manager_add_and_activate_connection (self=0x555555957210, settings=<optimized out>, device_path=<optimized out>, specific_object_path=0x0, context=0x555555a055f0) at nm-manager.c:3495
-rw-r--r--src/NetworkManagerUtils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c
index fdaa31cd77..91f26fd558 100644
--- a/src/NetworkManagerUtils.c
+++ b/src/NetworkManagerUtils.c
@@ -1447,7 +1447,8 @@ nm_utils_get_ip_config_method (NMConnection *connection,
return NM_SETTING_IP4_CONFIG_METHOD_DISABLED;
else {
s_ip4 = nm_connection_get_setting_ip4_config (connection);
- g_return_val_if_fail (s_ip4 != NULL, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
+ 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);
@@ -1461,7 +1462,8 @@ nm_utils_get_ip_config_method (NMConnection *connection,
return NM_SETTING_IP6_CONFIG_METHOD_IGNORE;
else {
s_ip6 = nm_connection_get_setting_ip6_config (connection);
- g_return_val_if_fail (s_ip6 != NULL, NM_SETTING_IP6_CONFIG_METHOD_AUTO);
+ 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);