diff options
-rw-r--r-- | src/devices/nm-device.c | 8 | ||||
-rw-r--r-- | src/nm-config.h | 4 | ||||
-rw-r--r-- | src/nm-manager.c | 2 | ||||
-rw-r--r-- | src/settings/plugins/ifnet/plugin.c | 4 | ||||
-rw-r--r-- | src/settings/plugins/ifupdown/plugin.c | 2 |
5 files changed, 12 insertions, 8 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 430c6f28c3..dcdd29e440 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -805,7 +805,7 @@ _get_ipx_route_metric (NMDevice *self, /* use the current NMConfigData, which makes this configuration reloadable. * Note that that means that the route-metric might change between SIGHUP. * You must cache the returned value if that is a problem. */ - value = nm_config_data_get_connection_default (nm_config_get_data (nm_config_get ()), + value = nm_config_data_get_connection_default (NM_CONFIG_GET_DATA, is_v4 ? "ipv4.route-metric" : "ipv6.route-metric", self); if (value) { route_metric = _nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXUINT32, -1); @@ -2329,7 +2329,7 @@ nm_device_generate_connection (NMDevice *self, NMDevice *master) && g_strcmp0 (ip6_method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0 && !nm_setting_connection_get_master (NM_SETTING_CONNECTION (s_con)) && !priv->slaves - && !nm_config_data_get_assume_ipv6ll_only (nm_config_get_data (nm_config_get ()), self)) { + && !nm_config_data_get_assume_ipv6ll_only (NM_CONFIG_GET_DATA, self)) { _LOGD (LOGD_DEVICE, "ignoring generated connection (IPv6LL-only and not in master-slave relationship)"); g_object_unref (connection); connection = NULL; @@ -4902,7 +4902,7 @@ _ip6_privacy_get (NMDevice *self) } } - value = nm_config_data_get_connection_default (nm_config_get_data (nm_config_get ()), + value = nm_config_data_get_connection_default (NM_CONFIG_GET_DATA, "ipv6.ip6-privacy", self); /* 2.) use the default value from the configuration. */ @@ -8454,7 +8454,7 @@ _set_state_full (NMDevice *self, if (nm_device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) { /* We cache the ignore_carrier state to not react on config-reloads while the connection * is active. But on deactivating, reset the ignore-carrier flag to the current state. */ - priv->ignore_carrier = nm_config_data_get_ignore_carrier (nm_config_get_data (nm_config_get ()), self); + priv->ignore_carrier = nm_config_data_get_ignore_carrier (NM_CONFIG_GET_DATA, self); } if (quitting) { diff --git a/src/nm-config.h b/src/nm-config.h index 8a08e0bb36..0dadf2e4b4 100644 --- a/src/nm-config.h +++ b/src/nm-config.h @@ -69,6 +69,10 @@ char *nm_config_change_flags_to_string (NMConfigChangeFlags flags); NMConfigData *nm_config_get_data (NMConfig *config); NMConfigData *nm_config_get_data_orig (NMConfig *config); + +#define NM_CONFIG_GET_DATA (nm_config_get_data (nm_config_get ())) +#define NM_CONFIG_GET_DATA_ORIG (nm_config_get_data_orig (nm_config_get ())) + const char **nm_config_get_plugins (NMConfig *config); gboolean nm_config_get_monitor_connection_files (NMConfig *config); gboolean nm_config_get_auth_polkit (NMConfig *config); diff --git a/src/nm-manager.c b/src/nm-manager.c index d32ab2167f..cd73125213 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2472,7 +2472,7 @@ should_connect_slaves (NMConnection *connection, NMDevice *device) goto out; /* Check configuration default for autoconnect-slaves property */ - value = nm_config_data_get_connection_default (nm_config_get_data (nm_config_get ()), + value = nm_config_data_get_connection_default (NM_CONFIG_GET_DATA, "connection.autoconnect-slaves", device); if (value) autoconnect_slaves = _nm_utils_ascii_str_to_int64 (value, 10, 0, 1, -1); diff --git a/src/settings/plugins/ifnet/plugin.c b/src/settings/plugins/ifnet/plugin.c index 814fd238b8..3f7a7db9e9 100644 --- a/src/settings/plugins/ifnet/plugin.c +++ b/src/settings/plugins/ifnet/plugin.c @@ -84,7 +84,7 @@ is_managed_plugin (void) { char *result = NULL; - result = nm_config_data_get_value (nm_config_get_data_orig (nm_config_get ()), + result = nm_config_data_get_value (NM_CONFIG_GET_DATA_ORIG, IFNET_KEY_FILE_GROUP, IFNET_KEY_FILE_KEY_MANAGED); if (result) { gboolean ret = is_true (result); @@ -217,7 +217,7 @@ reload_connections (NMSystemConfigInterface *config) nm_log_info (LOGD_SETTINGS, "Loading connections"); - str_auto_refresh = nm_config_data_get_value (nm_config_get_data_orig (nm_config_get ()), + str_auto_refresh = nm_config_data_get_value (NM_CONFIG_GET_DATA_ORIG, IFNET_KEY_FILE_GROUP, "auto_refresh"); if (str_auto_refresh && is_true (str_auto_refresh)) auto_refresh = TRUE; diff --git a/src/settings/plugins/ifupdown/plugin.c b/src/settings/plugins/ifupdown/plugin.c index fc828bd312..081de24a57 100644 --- a/src/settings/plugins/ifupdown/plugin.c +++ b/src/settings/plugins/ifupdown/plugin.c @@ -419,7 +419,7 @@ SCPluginIfupdown_init (NMSystemConfigInterface *config) g_hash_table_destroy (auto_ifaces); /* Check the config file to find out whether to manage interfaces */ - value = nm_config_data_get_value (nm_config_get_data_orig (nm_config_get ()), + value = nm_config_data_get_value (NM_CONFIG_GET_DATA_ORIG, IFUPDOWN_KEY_FILE_GROUP, IFUPDOWN_KEY_FILE_KEY_MANAGED); if (value) { gboolean manage_well_known; |